Portability patches for GNU/Hurd
Subsystems (2)
Hi!
The subject says is all. :-)
Grüße,
Thomas
PATCH 1/1 test_pager: Repair build for non-Linux.
--- lib/Makefile.am | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
lib/Makefile.am +1 -1
@@ -27,6 +27,7 @@ test_blkdev_SOURCES = blkdev.c test_ismounted_SOURCES = ismounted.c test_wholedisk_SOURCES = wholedisk.c test_mangle_SOURCES = mangle.c +test_pager_SOURCES = pager.c test_at_SOURCES = at.c test_at_CFLAGS = -DTEST_PROGRAM_AT
@@ -38,7 +39,6 @@ test_procutils_SOURCES = procutils.c if LINUX test_cpuset_SOURCES = cpuset.c test_sysfs_SOURCES = sysfs.c at.c -test_pager_SOURCES = pager.c test_sysfs_CFLAGS = -DTEST_PROGRAM_SYSFS test_loopdev_SOURCES = \
Signature · 1 line
1.7.9
Re: [PATCH] test_pager: Repair build for non-Linux.
Quoted 2 lines · Thomas Schwinge
lib/Makefile.am | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
Applied, thanks.
Signature · 2 lines
Karel Zak <[email protected]> http://karelzak.blogspot.com
PATCH 1/7 kill, raw, rename: Don't explicitly enable for --enable-most-builds.
In reply to Thomas SchwingeThey're already dealt with in the default configuration.
--- configure.ac | 3 --- 1 files changed, 0 insertions(+), 3 deletions(-)
configure.ac +0 -3
@@ -631,12 +631,9 @@ if test "x$enable_most_builds" = xyes; then enable_arch=yes enable_ddate=yes enable_elvtune=yes - enable_kill=yes enable_last=yes enable_line=yes enable_mesg=yes - enable_raw=yes - enable_rename=yes enable_reset=yes enable_login_utils=yes enable_write=yes
Signature · 1 line
1.7.9
PATCH 2/7 arch, eject, elvtune: Gracefully disable on non-Linux platforms.
--- configure.ac | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
configure.ac +3 -3
@@ -628,9 +628,9 @@ AC_ARG_ENABLE([most-builds], [], enable_most_builds=no ) if test "x$enable_most_builds" = xyes; then - enable_arch=yes + enable_arch=check enable_ddate=yes - enable_elvtune=yes + enable_elvtune=check enable_last=yes enable_line=yes enable_mesg=yes
@@ -862,7 +862,7 @@ AC_SUBST([ruman1dir]) AC_ARG_ENABLE([eject], AS_HELP_STRING([--disable-eject], [do not build eject]), - [], enable_eject=yes + [], enable_eject=check ) UL_BUILD_INIT([eject]) UL_REQUIRES_LINUX([eject])
Signature · 1 line
1.7.9
Re: [PATCH 2/7] arch, eject, elvtune: Gracefully disable on non-Linux platforms.
Quoted 2 lines · Thomas Schwinge
configure.ac | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
Applied, thanks.
Signature · 2 lines
Karel Zak <[email protected]> http://karelzak.blogspot.com
PATCH 3/7 last, login, write: Provide a fallback for MAXHOSTNAMELEN, as elsewhere.
In reply to Thomas Schwinge--- login-utils/last.c | 8 ++++++++ login-utils/login.c | 8 ++++++++ term-utils/write.c | 8 ++++++++ 3 files changed, 24 insertions(+), 0 deletions(-)
login-utils/last.c +8 -0
@@ -62,6 +62,14 @@#include "xalloc.h" #include "c.h" +#ifndef MAXHOSTNAMELEN +# ifdef HOST_NAME_MAX +# define MAXHOSTNAMELEN HOST_NAME_MAX +# else +# define MAXHOSTNAMELEN 64 +# endif +#endif +#define SECDAY (24*60*60)/* seconds in a day */ #define NO 0/* false/no */ #define YES 1/* true/yes */
login-utils/login.c +8 -0
@@ -71,6 +71,14 @@#include "logindefs.h" +#ifndef MAXHOSTNAMELEN +# ifdef HOST_NAME_MAX +# define MAXHOSTNAMELEN HOST_NAME_MAX +# else +# define MAXHOSTNAMELEN 64 +# endif +#endif +#define is_pam_failure (_rc) ((_rc) != PAM_SUCCESS)#define LOGIN_MAX_TRIES 3
term-utils/write.c +8 -0
@@ -65,6 +65,14 @@#include "closestream.h" #include "nls.h" +#ifndef MAXHOSTNAMELEN +# ifdef HOST_NAME_MAX +# define MAXHOSTNAMELEN HOST_NAME_MAX +# else +# define MAXHOSTNAMELEN 64 +# endif +#endif +static void __attribute__ ((__noreturn__))usage (FILE * out);void search_utmp (char *,char *,char *,uid_t );void do_write (char *,char *,uid_t );
Signature · 1 line
1.7.9
Karel Zak
maintainerRe: [PATCH 3/7] last, login, write: Provide a fallback for MAXHOSTNAMELEN, as elsewhere.
Quoted 6 lines · Thomas Schwinge
Signed-off-by Thomas Schwinge <[email protected]>--- login-utils/last.c | 8 ++++++++ login-utils/login.c | 8 ++++++++ term-utils/write.c | 8 ++++++++ 3 files changed, 24 insertions(+), 0 deletions(-)
I have moved the fallback for MAXHOSTNAMELEN to c.h, it seems better than duplicate the code. Thanks.
Karel
Signature · 2 lines
Karel Zak <[email protected]> http://karelzak.blogspot.com
Re: [PATCH 3/7] last, login, write: Provide a fallback for MAXHOSTNAMELEN, as elsewhere.
Hi!
Quoted 10 lines · Karel Zak
Quoted 6 lines · Thomas Schwinge
Signed-off-by Thomas Schwinge <[email protected]>--- login-utils/last.c | 8 ++++++++ login-utils/login.c | 8 ++++++++ term-utils/write.c | 8 ++++++++ 3 files changed, 24 insertions(+), 0 deletions(-)I have moved the fallback for MAXHOSTNAMELEN to
c.h, it seems better than duplicate the code. Thanks.
Yes, of course that makes even more sense. Thanks also for applying the others.
Grüße,
Thomas
PATCH 4/7 login: Include <linux/major.h> only if it exists.
In reply to Thomas SchwingeIt isn't required on non-Linux systems.
--- login-utils/login.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
login-utils/login.c +3 -1
@@ -49,7 +49,9 @@#include <stdlib.h> #include <sys/syslog.h> #include <sys/sysmacros.h> -#include <linux/major.h> +#ifdef HAVE_LINUX_MAJOR_H +# include <linux/major.h> +#endif #include <netdb.h> #include <lastlog.h> #include <security/pam_appl.h>
Signature · 1 line
1.7.9
PATCH 5/7 write: Use PATH_MAX instead of MAXPATHLEN, as elsewhere.
In reply to Thomas Schwinge--- term-utils/write.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
term-utils/write.c +3 -3
@@ -102,7 +102,7 @@ int main(int argc, char **argv)time_t atime;uid_t myuid;int msgsok, myttyfd, c; -char tty[MAXPATHLEN ], *mytty; +char tty[PATH_MAX ], *mytty;static const struct option longopts[] = { {"version" , no_argument,NULL ,'V' },
@@ -296,7 +296,7 @@ void search_utmp(char *user, char *tty, char *mytty, uid_t myuid)int term_chk (char *tty,int *msgsokP,time_t * atimeP,int showerror) {struct stat s; -char path[MAXPATHLEN ]; +char path[PATH_MAX ];if (strlen (tty) +6 >sizeof (path))return 1 ;
@@ -321,7 +321,7 @@ void do_write(char *tty, char *mytty, uid_t myuid)char *login, *pwuid, *nows;struct passwd *pwd;time_t now; -char path[MAXPATHLEN ], host[MAXHOSTNAMELEN ], line[512 ]; +char path[PATH_MAX ], host[MAXHOSTNAMELEN ], line[512 ];/* Determine our login name(s) before the we reopen() stdout */ if ((pwd =getpwuid (myuid)) !=NULL )
Signature · 1 line
1.7.9
Re: [PATCH 5/7] write: Use PATH_MAX instead of MAXPATHLEN, as elsewhere.
Quoted 2 lines · Thomas Schwinge
term-utils/write.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
Applied, thanks.
Signature · 2 lines
Karel Zak <[email protected]> http://karelzak.blogspot.com
PATCH 6/7 write: Don't explicitly include <asm/param.h>.
In reply to Thomas SchwingeIt doesn't exist on some systems, but will come in via <sys/param.h> on the others.
--- term-utils/write.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)
term-utils/write.c +0 -1
@@ -57,7 +57,6 @@#include <sys/param.h> #include <sys/stat.h> #include <paths.h> -#include <asm/param.h> #include <getopt.h> #include "c.h"
Signature · 1 line
1.7.9
Re: [PATCH 6/7] write: Don't explicitly include <asm/param.h>.
Quoted 2 lines · Thomas Schwinge
term-utils/write.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)
Applied, thanks.
Signature · 2 lines
Karel Zak <[email protected]> http://karelzak.blogspot.com
PATCH 7/7 setsid: Include <sys/ioctl.h> instead of <termio.h>.
In reply to Thomas Schwinge--- sys-utils/setsid.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
sys-utils/setsid.c +1 -1
@@ -15,7 +15,7 @@#include <stdio.h> #include <stdlib.h> #include <unistd.h> -#include <termio.h> +#include <sys/ioctl.h> #include "c.h" #include "nls.h"
Signature · 1 line
1.7.9
Re: [PATCH 7/7] setsid: Include <sys/ioctl.h> instead of <termio.h>.
Quoted 2 lines · Thomas Schwinge
sys-utils/setsid.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
Applied, thanks.
Signature · 2 lines
Karel Zak <[email protected]> http://karelzak.blogspot.com
Re: [PATCH 1/7] kill, raw, rename: Don't explicitly enable for --enable-most-builds.
In reply to Thomas SchwingeQuoted 2 lines · Thomas Schwinge
configure.ac | 3 --- 1 files changed, 0 insertions(+), 3 deletions(-)
Applied, thanks.
Signature · 2 lines
Karel Zak <[email protected]> http://karelzak.blogspot.com