+Wed Oct 6 14:40:33 CEST 1999 Wichert Akkerman <wakkerma@debian.org>
+
+ * 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 <wakkerma@debian.org>
* Set docdir to $(datadir)/doc
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"));
}
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"));
}
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
};
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;
}
}
+ 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."),