X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fexamples%2Fhex-dump.c;h=ee313f2e84d2790ce173653e4f786389346e4551;hb=0db48366884f3d6418217b926c4febc1bc2a3c13;hp=713d9737f209ee7d9ca6f6efa860d05cb830f07f;hpb=bfc9e18a6723b2315ef521282a8b42119338ece9;p=pintos-anon diff --git a/src/examples/hex-dump.c b/src/examples/hex-dump.c index 713d973..ee313f2 100644 --- a/src/examples/hex-dump.c +++ b/src/examples/hex-dump.c @@ -8,6 +8,7 @@ int main (int argc, char *argv[]) { + bool success = true; int i; for (i = 1; i < argc; i++) @@ -16,6 +17,7 @@ main (int argc, char *argv[]) if (fd < 0) { printf ("%s: open failed\n", argv[i]); + success = false; continue; } for (;;) @@ -29,5 +31,5 @@ main (int argc, char *argv[]) } close (fd); } - return 0; + return success ? EXIT_SUCCESS : EXIT_FAILURE; }