From c792262b137a5f2daddac22f82e7d8d98d0d7d31 Mon Sep 17 00:00:00 2001 From: Andrew Gregory Date: Wed, 6 Aug 2014 16:36:00 -0400 Subject: wrap fgets to retry on EINTR The read() underlying fgets() can be interrupted by a signal handler causing fgets() to return NULL. Before we started handling SIGWINCH, the odds of interrupting a read were low and typically resulted in termination anyway. Replace all fgets calls with a wrapper that retries in EINTR. Signed-off-by: Andrew Gregory --- src/pacman/ini.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/pacman/ini.c') diff --git a/src/pacman/ini.c b/src/pacman/ini.c index 2a3ef0ed..2eb32302 100644 --- a/src/pacman/ini.c +++ b/src/pacman/ini.c @@ -66,7 +66,7 @@ static int _parse_ini(const char *file, ini_parser_fn cb, void *data, goto cleanup; } - while(fgets(line, PATH_MAX, fp)) { + while(safe_fgets(line, PATH_MAX, fp)) { char *key, *value, *ptr; size_t line_len; -- cgit v1.2.3