diff options
author | Daniel Kahn Gillmor <dkg@fifthhorseman.net> | 2022-02-04 17:32:17 -0500 |
---|---|---|
committer | Daniel Kahn Gillmor <dkg@fifthhorseman.net> | 2022-02-04 19:04:45 -0500 |
commit | bc24e278ff34355cd6fba9369863df875a58210e (patch) | |
tree | 38d0a8c81e9fcad5e677ae830567b9b9551a27db | |
parent | b0b9432ea4adabf8429ea52107eefd11f0fff907 (diff) | |
download | libfaketime-bc24e278ff34355cd6fba9369863df875a58210e.tar.gz |
Avoid spurious "Success" error message.
strptime(3) doesn't set errno, so when it was failing, calling perror()
meant producing messages like:
Failed to parse FAKETIME timestamp: Success
Rather than use perror(), just send the warning message directly to
stderr.
This was first reported in https://bugs.debian.org/939789
-rw-r--r-- | src/libfaketime.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libfaketime.c b/src/libfaketime.c index 09dced2..9a0522f 100644 --- a/src/libfaketime.c +++ b/src/libfaketime.c @@ -2374,8 +2374,8 @@ static void parse_ft_string(const char *user_faked_time) } else { - perror("libfaketime: In parse_ft_string(), failed to parse FAKETIME timestamp"); - fprintf(stderr, "Please check specification %s with format %s\n", user_faked_time, user_faked_time_fmt); + fprintf(stderr, "libfaketime: In parse_ft_string(), failed to parse FAKETIME timestamp.\n" + "Please check specification %s with format %s\n", user_faked_time, user_faked_time_fmt); exit(EXIT_FAILURE); } break; @@ -2418,7 +2418,7 @@ static void parse_ft_string(const char *user_faked_time) } else { - perror("libfaketime: In parse_ft_string(), failed to parse FAKETIME timestamp"); + fprintf(stderr, "libfaketime: In parse_ft_string(), failed to parse FAKETIME timestamp.\n"); exit(EXIT_FAILURE); } |