[BusyBox 0003514]: runsvdir always warns it cannot read the directory
bugs at busybox.net
bugs at busybox.net
Sat May 31 00:00:47 PDT 2008
The following issue has been CLOSED
======================================================================
http://busybox.net/bugs/view.php?id=3514
======================================================================
Reported By: mnemoc
Assigned To: BusyBox
======================================================================
Project: BusyBox
Issue ID: 3514
Category: Other
Reproducibility: always
Severity: minor
Priority: normal
Status: closed
Resolution: open
Fixed in Version:
======================================================================
Date Submitted: 05-29-2008 11:58 PDT
Last Modified: 05-31-2008 00:00 PDT
======================================================================
Summary: runsvdir always warns it cannot read the directory
Description:
the logic of runsvdir assumes just readdir() may set errno, and relies on
that to decide when to warn.
but runsv() calls vfork() which is always setting errno=2 when pid>0, so
one always gets:
runsvdir: /var/service: warning: cannot read directory /var/service
I know `runsvdir` is not guilty, but I didn't know what to do on vfork()'s
code to try to fix it
======================================================================
----------------------------------------------------------------------
vda - 05-30-08 23:57
----------------------------------------------------------------------
This looks like better fix, no?
--- busybox.1/runit/runsvdir.c 2008-05-28 14:00:33.000000000 +0200
+++ busybox.2/runit/runsvdir.c 2008-05-31 08:54:05.000000000 +0200
@@ -141,8 +141,12 @@ static void runsvdir(void)
}
for (i = 0; i < svnum; i++)
sv[i].isgone = 1;
- errno = 0;
- while ((d = readdir(dir))) {
+
+ while (1) {
+ errno = 0;
+ d = readdir(dir);
+ if (!d)
+ break;
if (d->d_name[0] == '.')
continue;
if (stat(d->d_name, &s) == -1) {
----------------------------------------------------------------------
vda - 05-31-08 00:00
----------------------------------------------------------------------
Fixed in rev 22130.
Issue History
Date Modified Username Field Change
======================================================================
05-29-08 11:58 mnemoc New Issue
05-29-08 11:58 mnemoc Status new => assigned
05-29-08 11:58 mnemoc Assigned To => BusyBox
05-29-08 11:58 mnemoc File Added: pkg_busybox.patch
05-30-08 23:57 vda Note Added: 0007914
05-31-08 00:00 vda Status assigned => closed
05-31-08 00:00 vda Note Added: 0007924
======================================================================
More information about the busybox-cvs
mailing list