From 7f2d7ff0b5c4f352047b09e019660d9d0791cc31 Mon Sep 17 00:00:00 2001 From: Stathis Kamperis Date: Sun, 20 Jan 2008 22:10:17 +0100 Subject: [PATCH] Don't use errx(); use perror+exit instead --- ipc/popen_ls.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ipc/popen_ls.c b/ipc/popen_ls.c index 573aead..4d5c57e 100644 --- a/ipc/popen_ls.c +++ b/ipc/popen_ls.c @@ -1,4 +1,3 @@ -#include /* for errx() */ #include #include #include /* for waitpid() macros */ @@ -13,8 +12,10 @@ int main(void) /* Initiate pipe stream to ``ls'' */ fp = popen("ls", "r"); - if (fp == NULL) - errx(EXIT_FAILURE, "popen()"); + if (fp == NULL) { + perror("popen()"); + exit(EXIT_FAILURE); + } /* Read from stream */ while (fgets(str, MAX_STR, fp) != NULL) { @@ -24,7 +25,8 @@ int main(void) /* Close pipe stream */ ret = pclose(fp); if (ret == -1) { - errx(EXIT_FAILURE, "pclose()"); + perror("pclose()"); + exit(EXIT_FAILURE); } else { /* -- 2.11.4.GIT