projects
/
oweals
/
musl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
af05173
)
getdate: correctly specify error number
author
A. Wilcox
<AWilcox@Wilcox-Tech.com>
Fri, 9 Jun 2017 05:26:18 +0000
(
00:26
-0500)
committer
Rich Felker
<dalias@aerifal.cx>
Wed, 14 Jun 2017 23:50:58 +0000
(19:50 -0400)
POSIX defines getdate error #5 as:
"An I/O error is encountered while reading the template file."
POSIX defines getdate error #7 as:
"There is no line in the template that matches the input."
This change correctly disambiguates between the two error conditions.
src/time/getdate.c
patch
|
blob
|
history
diff --git
a/src/time/getdate.c
b/src/time/getdate.c
index 89f21699125655eb27b1efa780a4e6f7ef0755de..420cd8e4126bc4112e74afbd5715c1dbc3579f01 100644
(file)
--- a/
src/time/getdate.c
+++ b/
src/time/getdate.c
@@
-37,7
+37,8
@@
struct tm *getdate(const char *s)
}
}
- getdate_err = 7;
+ if (ferror(f)) getdate_err = 5;
+ else getdate_err = 7;
out:
if (f) fclose(f);
pthread_setcancelstate(cs, 0);