From: Wichert Akkerman Date: Wed, 6 Oct 1999 13:04:41 +0000 (+0000) Subject: Updates for Hurd X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6bdebc1cb00cb3cced0bd0ca8e46bf22f1205f1a;p=dpkg Updates for Hurd --- diff --git a/ChangeLog b/ChangeLog index 4be74bd3..ac652751 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Wed Oct 6 14:40:33 CEST 1999 Wichert Akkerman + + * Lock complete lockfile for database: it's empty anyway, and Hurd + doesn't support partial locks currently + * Don't use PATH_MAX but allocate necessay memory in checkpath(). + Useful for system that don't have PATH_MAX (like Hurd) + Tue Oct 5 19:16:38 CEST 1999 Wichert Akkerman * Set docdir to $(datadir)/doc diff --git a/lib/lock.c b/lib/lock.c index 62464682..b4b0e601 100644 --- a/lib/lock.c +++ b/lib/lock.c @@ -42,7 +42,7 @@ static void cu_unlockdb(int argc, void **argv) { fl.l_type= F_UNLCK; fl.l_whence= SEEK_SET; fl.l_start= 0; - fl.l_len= 1; + fl.l_len= 0; if (fcntl(dblockfd,F_SETLK,&fl) == -1) ohshite(_("unable to unlock dpkg status database")); } @@ -72,7 +72,7 @@ void lockdatabase(const char *admindir) { fl.l_type= F_WRLCK; fl.l_whence= SEEK_SET; fl.l_start= 0; - fl.l_len= 1; + fl.l_len= 0; if (fcntl(dblockfd,F_SETLK,&fl) == -1) { if (errno == EWOULDBLOCK || errno == EAGAIN) ohshit(_("status database area is locked - another dpkg/dselect is running")); diff --git a/main/help.c b/main/help.c index 9c74e29e..98620a2a 100644 --- a/main/help.c +++ b/main/help.c @@ -66,6 +66,7 @@ struct filenamenode *namenodetouse(struct filenamenode *namenode, struct pkginfo } void checkpath(void) { +/* Verify that some programs can be found in the PATH. */ static const char *const checklist[]= { "ldconfig", "start-stop-daemon", "install-info", "update-rc.d", 0 }; @@ -73,12 +74,13 @@ void checkpath(void) { struct stat stab; const char *const *clp; const char *path, *s, *p; - char buf[PATH_MAX+2]; + char* buf; int warned= 0; long l; path= getenv("PATH"); if (!path) fputs(_("dpkg - warning: PATH is not set.\n"), stderr); + buf=(char*)m_malloc(strlen(path)+1); for (clp=checklist; *clp; clp++) { s= path; @@ -98,6 +100,7 @@ void checkpath(void) { } } + free(buf); if (warned) forcibleerr(fc_badpath,_("%d expected program(s) not found on PATH.\nNB: root's " "PATH should usually contain /usr/local/sbin, /usr/sbin and /sbin."),