提交 10800088 编写于 作者: A A. Wilcox 提交者: Rich Felker

getdate: correctly specify error number

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.
上级 af051730
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册