summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Gumberg2014-03-02 11:59:19 -0600
committerDavid Gumberg2014-03-02 12:35:49 -0600
commit1c3cb91f72a9745f2956c160729887488e2806ed (patch)
tree3066389f18808b89358491af97cafc3b25fe5fce
parenta0e4d1643cc74748c3b5b05da0d41b7dbcda23e5 (diff)
downloadplatform-system-core-1c3cb91f72a9745f2956c160729887488e2806ed.tar.gz
platform-system-core-1c3cb91f72a9745f2956c160729887488e2806ed.tar.xz
platform-system-core-1c3cb91f72a9745f2956c160729887488e2806ed.zip
Use the getopt function in compliance with the standard.
This is a simple change to the use of getopt in reboot.c, as per the standard, getopt does NOT return an EOF, it returns a -1, (this was done to remove getopt's dependence on stdio.h), and since the standard does not guarantee that EOF is -1, and the documentation tells us that getopt returns -1, in my judgement it would be best to test for -1, rather than EOF. Change-Id: I63a3bb7011eb60753eb910221bbe8ce0a71e6679 Signed-off-by: David Gumberg <davidzgumberg@gmail.com>
-rw-r--r--reboot/reboot.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/reboot/reboot.c b/reboot/reboot.c
index d9a422764..007dfbaa4 100644
--- a/reboot/reboot.c
+++ b/reboot/reboot.c
@@ -35,7 +35,7 @@ int main(int argc, char *argv[])
35 35
36 c = getopt(argc, argv, "p"); 36 c = getopt(argc, argv, "p");
37 37
38 if (c == EOF) { 38 if (c == -1) {
39 break; 39 break;
40 } 40 }
41 41