{"id":203,"url":"http://patchwork.ozlabs.org/api/1.1/patches/203/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-mtd/patch/1220856329-22740-1-git-send-email-gerickson@nuovations.com/","project":{"id":3,"url":"http://patchwork.ozlabs.org/api/1.1/projects/3/?format=json","name":"Linux MTD development","link_name":"linux-mtd","list_id":"linux-mtd.lists.infradead.org","list_email":"linux-mtd@lists.infradead.org","web_url":null,"scm_url":null,"webscm_url":null},"msgid":"<1220856329-22740-1-git-send-email-gerickson@nuovations.com>","date":"2008-09-08T06:45:29","name":"nanddump: Utilize Standard Exit Mnemonics","commit_ref":"f4f8263572574f682098011d8dced98787aa7c27","pull_url":null,"state":"accepted","archived":false,"hash":"d0ca60527fd3dd626b4743653a8c4f06469f9c5a","submitter":{"id":115,"url":"http://patchwork.ozlabs.org/api/1.1/people/115/?format=json","name":"Grant Erickson","email":"gerickson@nuovations.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/linux-mtd/patch/1220856329-22740-1-git-send-email-gerickson@nuovations.com/mbox/","series":[],"comments":"http://patchwork.ozlabs.org/api/patches/203/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/203/checks/","tags":{},"headers":{"Return-Path":"<linux-mtd-bounces+patchwork=ozlabs.org@lists.infradead.org>","X-Original-To":"patchwork@ozlabs.org","Delivered-To":"patchwork@ozlabs.org","Received":["from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34])\n\t(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\n\t(Client did not present a certificate)\n\tby ozlabs.org (Postfix) with ESMTPS id 5AB6ADDE1E\n\tfor <patchwork@ozlabs.org>; Mon,  8 Sep 2008 16:45:48 +1000 (EST)","from localhost ([127.0.0.1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.68 #1 (Red Hat Linux))\n\tid 1KcaVB-0004Hm-Tr; Mon, 08 Sep 2008 06:45:33 +0000","from relay03.pair.com ([209.68.5.17])\n\tby bombadil.infradead.org with smtp (Exim 4.68 #1 (Red Hat Linux))\n\tid 1KcaVA-00043D-2g\n\tfor linux-mtd@lists.infradead.org; Mon, 08 Sep 2008 06:45:32 +0000","(qmail 70648 invoked by uid 0); 8 Sep 2008 06:45:30 -0000","from unknown (HELO localhost.localdomain) (unknown)\n\tby unknown with SMTP; 8 Sep 2008 06:45:30 -0000"],"X-pair-Authenticated":"66.134.71.115","From":"Grant Erickson <gerickson@nuovations.com>","To":"linux-mtd@lists.infradead.org","Subject":"[PATCH 2/6] [MTD-UTILS] nanddump: Utilize Standard Exit Mnemonics","Date":"Sun,  7 Sep 2008 23:45:29 -0700","Message-Id":"<1220856329-22740-1-git-send-email-gerickson@nuovations.com>","X-Mailer":"git-send-email 1.6.0.1","Organization":"Nuovation System Designs, LLC","X-Spam-Score":"-1.0 (-)","X-Spam-Report":"SpamAssassin version 3.2.5 on bombadil.infradead.org summary:\n\tContent analysis details:   (-1.0 points)\n\tpts rule name              description\n\t---- ----------------------\n\t--------------------------------------------------\n\t-1.0 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/,\n\tlow trust [209.68.5.17 listed in list.dnswl.org]","X-BeenThere":"linux-mtd@lists.infradead.org","X-Mailman-Version":"2.1.9","Precedence":"list","List-Id":"Linux MTD discussion mailing list <linux-mtd.lists.infradead.org>","List-Unsubscribe":"<http://lists.infradead.org/mailman/listinfo/linux-mtd>,\n\t<mailto:linux-mtd-request@lists.infradead.org?subject=unsubscribe>","List-Archive":"<http://lists.infradead.org/pipermail/linux-mtd>","List-Post":"<mailto:linux-mtd@lists.infradead.org>","List-Help":"<mailto:linux-mtd-request@lists.infradead.org?subject=help>","List-Subscribe":"<http://lists.infradead.org/mailman/listinfo/linux-mtd>,\n\t<mailto:linux-mtd-request@lists.infradead.org?subject=subscribe>","MIME-Version":"1.0","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Sender":"linux-mtd-bounces@lists.infradead.org","Errors-To":"linux-mtd-bounces+patchwork=ozlabs.org@lists.infradead.org"},"content":"Replace main exit and return status codes with equivalent mnemonics.\n\nSigned-off-by: Grant Erickson <gerickson@nuovations.com>","diff":"diff --git a/nanddump.c b/nanddump.c\nindex e35caf8..8c7175c 100644\n--- a/nanddump.c\n+++ b/nanddump.c\n@@ -51,7 +51,7 @@ static void display_help (void)\n \t\t\t\"-b         --omitbad            omit bad blocks from the dump\\n\"\n \t\t\t\"-p         --prettyprint        print nice (hexdump)\\n\"\n \t\t\t\"-s addr    --startaddress=addr  start address\\n\");\n-\texit(0);\n+\texit(EXIT_SUCCESS);\n }\n \n static void display_version (void)\n@@ -64,7 +64,7 @@ static void display_version (void)\n \t\t\t\"You may redistribute copies of \" PROGRAM \"\\n\"\n \t\t\t\"under the terms of the GNU General Public Licence.\\n\"\n \t\t\t\"See the file `COPYING' for more information.\\n\");\n-\texit(0);\n+\texit(EXIT_SUCCESS);\n }\n \n // Option variables\n@@ -126,7 +126,7 @@ static void process_options (int argc, char * const argv[])\n \t\t\tcase 'f':\n \t\t\t\tif (!(dumpfile = strdup(optarg))) {\n \t\t\t\t\tperror(\"stddup\");\n-\t\t\t\t\texit(1);\n+\t\t\t\t\texit(EXIT_FAILURE);\n \t\t\t\t}\n \t\t\t\tbreak;\n \t\t\tcase 'i':\n@@ -183,14 +183,14 @@ int main(int argc, char * const argv[])\n \t/* Open MTD device */\n \tif ((fd = open(mtddev, O_RDONLY)) == -1) {\n \t\tperror(\"open flash\");\n-\t\texit (1);\n+\t\texit (EXIT_FAILURE);\n \t}\n \n \t/* Fill in MTD device capability structure */\n \tif (ioctl(fd, MEMGETINFO, &meminfo) != 0) {\n \t\tperror(\"MEMGETINFO\");\n \t\tclose(fd);\n-\t\texit (1);\n+\t\texit (EXIT_FAILURE);\n \t}\n \n \t/* Make sure device page sizes are valid */\n@@ -201,7 +201,7 @@ int main(int argc, char * const argv[])\n \t\t\t!(meminfo.oobsize == 8 && meminfo.writesize == 256)) {\n \t\tfprintf(stderr, \"Unknown flash (not normal NAND)\\n\");\n \t\tclose(fd);\n-\t\texit(1);\n+\t\texit(EXIT_FAILURE);\n \t}\n \t/* Read the real oob length */\n \toob.length = meminfo.oobsize;\n@@ -216,19 +216,19 @@ int main(int argc, char * const argv[])\n \t\t\t\tif (ioctl (fd, MEMGETOOBSEL, &old_oobinfo) != 0) {\n \t\t\t\t\tperror (\"MEMGETOOBSEL\");\n \t\t\t\t\tclose (fd);\n-\t\t\t\t\texit (1);\n+\t\t\t\t\texit (EXIT_FAILURE);\n \t\t\t\t}\n \t\t\t\tif (ioctl (fd, MEMSETOOBSEL, &none_oobinfo) != 0) {\n \t\t\t\t\tperror (\"MEMSETOOBSEL\");\n \t\t\t\t\tclose (fd);\n-\t\t\t\t\texit (1);\n+\t\t\t\t\texit (EXIT_FAILURE);\n \t\t\t\t}\n \t\t\t\toobinfochanged = 1;\n \t\t\t\tbreak;\n \t\t\tdefault:\n \t\t\t\tperror (\"MTDFILEMODE\");\n \t\t\t\tclose (fd);\n-\t\t\t\texit (1);\n+\t\t\t\texit (EXIT_FAILURE);\n \t\t\t}\n \t\t}\n \t} else {\n@@ -251,7 +251,7 @@ int main(int argc, char * const argv[])\n \t} else if ((ofd = open(dumpfile, O_WRONLY | O_TRUNC | O_CREAT, 0644))== -1) {\n \t\tperror (\"open outfile\");\n \t\tclose(fd);\n-\t\texit(1);\n+\t\texit(EXIT_FAILURE);\n \t}\n \n \t/* Initialize start/end addresses and block size */\n@@ -379,7 +379,7 @@ int main(int argc, char * const argv[])\n \t\t\tperror (\"MEMSETOOBSEL\");\n \t\t\tclose(fd);\n \t\t\tclose(ofd);\n-\t\t\treturn 1;\n+\t\t\treturn EXIT_FAILURE;\n \t\t}\n \t}\n \t/* Close the output file and MTD device */\n@@ -387,7 +387,7 @@ int main(int argc, char * const argv[])\n \tclose(ofd);\n \n \t/* Exit happy */\n-\treturn 0;\n+\treturn EXIT_SUCCESS;\n \n closeall:\n \t/* The new mode change is per file descriptor ! */\n@@ -398,5 +398,5 @@ closeall:\n \t}\n \tclose(fd);\n \tclose(ofd);\n-\texit(1);\n+\texit(EXIT_FAILURE);\n }\n","prefixes":[]}