don't open files O_EXCL

CVS patchset: 278
CVS date: 1996/02/15 00:10:15
This commit is contained in:
ewt 1996-02-15 00:10:15 +00:00
parent 1ec84a6f63
commit ea3e7dcddb
1 changed files with 5 additions and 9 deletions

View File

@ -48,7 +48,7 @@ void doInstall(char * prefix, char * arg, int installFlags, int interfaceFlags)
if (installFlags & INSTALL_TEST) if (installFlags & INSTALL_TEST)
mode = O_RDONLY; mode = O_RDONLY;
else else
mode = O_RDWR | O_EXCL; mode = O_RDWR;
if (interfaceFlags & RPMINSTALL_PERCENT) if (interfaceFlags & RPMINSTALL_PERCENT)
fn = printPercent; fn = printPercent;
@ -57,14 +57,10 @@ void doInstall(char * prefix, char * arg, int installFlags, int interfaceFlags)
else else
fn = NULL; fn = NULL;
if (!rpmdbOpen(prefix, &db, mode, 0644)) { if (!rpmdbOpen(prefix, &db, mode | O_CREAT, 0644)) {
/* try opening it O_CREAT */ fprintf(stderr, "error: cannot open %s/var/lib/rpm/packages.rpm\n",
mode |= O_CREAT; prefix);
if (!rpmdbOpen(prefix, &db, mode, 0644)) { exit(1);
fprintf(stderr, "error: cannot open %s/var/lib/rpm/packages.rpm\n",
prefix);
exit(1);
}
} }
message(MESS_DEBUG, "installing %s\n", arg); message(MESS_DEBUG, "installing %s\n", arg);