MCPcopy Create free account
hub / github.com/coreutils/coreutils / apply_time_suffix

Function apply_time_suffix

src/timeout.c:341–368  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

339 and return false. Otherwise return true. */
340
341static bool
342apply_time_suffix (double *x, char suffix_char)
343{
344 int multiplier;
345
346 switch (suffix_char)
347 {
348 case 0:
349 case 's':
350 multiplier = 1;
351 break;
352 case 'm':
353 multiplier = 60;
354 break;
355 case 'h':
356 multiplier = 60 * 60;
357 break;
358 case 'd':
359 multiplier = 60 * 60 * 24;
360 break;
361 default:
362 return false;
363 }
364
365 *x = dtimespec_bound (*x * multiplier, 0);
366
367 return true;
368}
369
370static double
371parse_duration (char const *str)

Callers 1

parse_durationFunction · 0.85

Calls 1

dtimespec_boundFunction · 0.85

Tested by

no test coverage detected