From 65df4a10e9f542ef4d716219fb00203a5ad2afef Mon Sep 17 00:00:00 2001 From: ewt Date: Wed, 3 Apr 1996 03:46:41 +0000 Subject: [PATCH] doInstall() now returns success or error CVS patchset: 525 CVS date: 1996/04/03 03:46:41 --- install.c | 8 +++++--- install.h | 3 +-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/install.c b/install.c index aa68f6b82..bae49d3d2 100644 --- a/install.c +++ b/install.c @@ -41,7 +41,7 @@ static void printPercent(const unsigned long amount, const unsigned long total) fflush(stdout); } -void doInstall(char * prefix, char * arg, int installFlags, int interfaceFlags) { +int doInstall(char * prefix, char * arg, int installFlags, int interfaceFlags) { rpmdb db; int fd; int mode, rc; @@ -79,14 +79,14 @@ void doInstall(char * prefix, char * arg, int installFlags, int interfaceFlags) if (fd < 0) { fprintf(stderr, "error: ftp of %s failed - %s\n", arg, ftpStrerror(fd)); - return; + return 1; } } else { fd = open(arg, O_RDONLY); if (fd < 0) { rpmdbClose(db); fprintf(stderr, "error: cannot open %s\n", arg); - return; + return 1; } } @@ -110,6 +110,8 @@ void doInstall(char * prefix, char * arg, int installFlags, int interfaceFlags) close(fd); rpmdbClose(db); + + return rc; } void doUninstall(char * prefix, char * arg, int test, int uninstallFlags) { diff --git a/install.h b/install.h index 0588b73c8..efc8edf3d 100644 --- a/install.h +++ b/install.h @@ -4,8 +4,7 @@ #define RPMINSTALL_PERCENT 1 #define RPMINSTALL_HASH 2 -void doInstall(char * prefix, char * arg, int installFlags, - int interfaceFlags); +int doInstall(char * prefix, char * arg, int installFlags, int interfaceFlags); int doSourceInstall(char * prefix, char * arg, char ** specFile); void doUninstall(char * prefix, char * arg, int test, int uninstallFlags);