Hello,

Jesse Smith, le jeu. 15 nov. 2018 23:32:28 -0400, a ecrit:
> I'd like to chime in here. I do not currently run a Debian Hurd machine
> for testing, but I would like to hear how init compiles/runs on the Hurd
> port. If you have any sysvinit code patches in the future please feel
> free to CC them to me upstream at sysvinit-devel@nongnu.org or at
> jsm...@resonatingmedia.com.

It seems that the version in Debian experimental doesn't build any more.
Here is a patch that fixes it.

Samuel
--- src/consoles.c.original     2018-11-19 21:51:39.000000000 +0000
+++ src/consoles.c      2018-11-19 21:54:01.000000000 +0000
@@ -159,7 +159,7 @@
        fd = dirfd(dir);
        rewinddir(dir);
        while ((dent = readdir(dir))) {
-               char path[PATH_MAX];
+               char *path;
                struct stat st;
                if (fstatat(fd, dent->d_name, &st, 0) < 0)
                        continue;
@@ -167,9 +167,10 @@
                        continue;
                if (comparedev != st.st_rdev)
                        continue;
-               if ((size_t)snprintf(path, sizeof(path), "/dev/%s", 
dent->d_name) >= sizeof(path))
+               if (asprintf(&path, "/dev/%s", dent->d_name) < 0)
                        continue;
                name = realpath(path, NULL);
+               free(path);
                break;
        }
        return name;
--- src/sulogin.c.original      2018-11-19 21:50:11.000000000 +0000
+++ src/sulogin.c       2018-11-19 21:51:15.000000000 +0000
@@ -144,7 +144,9 @@
                cfsetispeed(tio, ispeed);
                cfsetospeed(tio, ospeed);
 
+#ifndef __GNU__
                tio->c_line         = 0;
+#endif
                tio->c_cc[VTIME]    = 0;
                tio->c_cc[VMIN]     = 1;
 
@@ -203,7 +205,7 @@
        tio->c_cc[VEOF]     = CEOF;
 # ifdef VSWTC
        tio->c_cc[VSWTC]    = _POSIX_VDISABLE;
-# else
+# elif defined(VSWTCH)
        tio->c_cc[VSWTCH]   = _POSIX_VDISABLE;
 # endif
        tio->c_cc[VSTART]   = CSTART;
@@ -261,7 +263,7 @@
        tio->c_cc[VEOF]     = CEOF;
 #ifdef VSWTC
        tio->c_cc[VSWTC]    = _POSIX_VDISABLE;
-#else
+#elif defined(VSWTCH)
        tio->c_cc[VSWTCH]   = _POSIX_VDISABLE;
 #endif
        tio->c_cc[VSTART]   = CSTART;

Reply via email to