From: jbj Date: Thu, 15 Aug 2002 22:25:33 +0000 (+0000) Subject: hp-ux: ETXTBSY fiddles. X-Git-Tag: tznext/4.11.0.1.tizen20130304~7234 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=105f7a517cd13b7c40b359548a9c75cbd00ed9c4;p=tools%2Flibrpm-tizen.git hp-ux: ETXTBSY fiddles. CVS patchset: 5642 CVS date: 2002/08/15 22:25:33 --- diff --git a/lib/fsm.c b/lib/fsm.c index be76dab..610546b 100644 --- a/lib/fsm.c +++ b/lib/fsm.c @@ -2005,6 +2005,18 @@ if (!(fsm->mapFlags & CPIO_ALL_HARDLINKS)) break; break; case FSM_RENAME: rc = Rename(fsm->opath, fsm->path); +#if defined(ETXTBSY) + if (rc && errno == ETXTBSY) { + char * path = alloca(strlen(fsm->path) + sizeof("-RPMDELETE")); + (void) stpcpy( stpcpy(path, fsm->path), "-RPMDELETE"); + /* + * XXX HP-UX (and other os'es) don't permit rename to busy + * XXX files. + */ + rc = Rename(fsm->path, path); + if (!rc) rc = Rename(fsm->opath, fsm->path); + } +#endif if (_fsm_debug && (stage & FSM_SYSCALL)) rpmMessage(RPMMESS_DEBUG, " %8s (%s, %s) %s\n", cur, fsm->opath, fsm->path, (rc < 0 ? strerror(errno) : ""));