Quiet gcc warnings on glibc systems that use warn_unused_result for

write(2) and others.
This commit is contained in:
Todd C. Miller
2010-08-03 11:17:56 -04:00
parent 1229406720
commit 420db23714
7 changed files with 52 additions and 24 deletions

View File

@@ -312,9 +312,12 @@ main(int argc, char *argv[])
error(1, "unable to open %s", path);
cp = NULL;
len = 0;
getline(&cp, &len, lfile); /* log */
getline(&cp, &len, lfile); /* cwd */
getline(&cp, &len, lfile); /* command */
/* Pull out command (third line). */
if (getline(&cp, &len, lfile) == -1 ||
getline(&cp, &len, lfile) == -1 ||
getline(&cp, &len, lfile) == -1) {
error(1, "invalid log file %s", path);
}
printf("Replaying sudo session: %s", cp);
free(cp);
fclose(lfile);