From: Craig Small Date: Mon, 25 Jul 2011 11:42:42 +0000 (+1000) Subject: Patch to make against cygwin X-Git-Tag: v22.15~14 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c48188744897e0a53c96c812760964b52f1bfc92;p=psmisc Patch to make against cygwin --- diff --git a/ChangeLog b/ChangeLog index 4605f7f..4217a09 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,7 @@ Changes in 22.15 ================ * Really apply patch for SF#31110178 RH#651794 * Conditionally use fork before stat calls + * Patch from Corrina Vinschen for compiling on cygwin Changes in 22.14 ================ diff --git a/configure.ac b/configure.ac index e8480cb..6177975 100644 --- a/configure.ac +++ b/configure.ac @@ -122,7 +122,7 @@ AC_FUNC_MALLOC AC_FUNC_MEMCMP AC_FUNC_REALLOC AC_FUNC_STAT -AC_CHECK_FUNCS([atexit getmntent memset nl_langinfo regcomp rpmatch setlocale socket strcasecmp strchr strdup strerror strpbrk strrchr strtoul]) +AC_CHECK_FUNCS([atexit getmntent memset nl_langinfo rawmemchr regcomp rpmatch setlocale socket strcasecmp strchr strdup strerror strpbrk strrchr strtoul]) dnl Checks for Large File System AC_SYS_LARGEFILE diff --git a/src/Makefile.am b/src/Makefile.am index 7cff9fd..4398631 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -23,21 +23,24 @@ if WANT_PEEKFD_MIPS AM_CFLAGS += -DMIPS endif - fuser_SOURCES = fuser.c comm.h signals.c signals.h i18n.h fuser.h lists.h +fuser_LDADD = @LIBINTL@ + killall_SOURCES = killall.c comm.h signals.c signals.h i18n.h -killall_LDADD = @SELINUX_LIB@ +killall_LDADD = @LIBINTL@ @SELINUX_LIB@ peekfd_SOURCES = peekfd.c pstree_SOURCES = pstree.c comm.h i18n.h -pstree_LDADD = @TERMCAP_LIB@ @SELINUX_LIB@ +pstree_LDADD = @LIBINTL@ @TERMCAP_LIB@ @SELINUX_LIB@ prtstat_SOURCES = prtstat.c prtstat.h +prtstat_LDADD = @LIBINTL@ + BUILT_SOURCES = signames.h EXTRA_DIST = signames.c diff --git a/src/fuser.c b/src/fuser.c index bef14e2..476fdf1 100644 --- a/src/fuser.c +++ b/src/fuser.c @@ -48,6 +48,12 @@ #include #include #include +#include +/* MAXSYMLINKS is a BSDism. If it doesn't exist, fall back to SYMLINK_MAX, + which is the POSIX name. */ +#ifndef MAXSYMLINKS +#define MAXSYMLINKS SYMLINK_MAX +#endif #include "fuser.h" #include "signals.h" @@ -1231,7 +1237,7 @@ print_matches(struct names *names_head, const opt_type opts, pwent->pw_name); } if (pptr->proc_type == PTYPE_NORMAL) - printf("%6d", pptr->pid); + printf(" %5d", pptr->pid); else printf("kernel"); fflush(stdout); @@ -1977,7 +1983,11 @@ char* expandpath(const char * path) if (*path != '/') { if (!getcwd(curr, PATH_MAX)) return (char*)0; +#ifdef HAVE_RAWMEMCHR dest = rawmemchr(curr, '\0'); +#else + dest = strchr(curr, '\0'); +#endif } else { *curr = '/'; dest = curr + 1; diff --git a/src/lists.h b/src/lists.h index d91bbdf..01c6648 100644 --- a/src/lists.h +++ b/src/lists.h @@ -68,7 +68,7 @@ extern inline void attribute((used,__gnu_inline__,always_inline,__artificial__)) asm volatile ("lfetch [%0]" :: "r" (x)) #elif defined(__powerpc64__) asm volatile ("dcbt 0,%0" :: "r" (x)) -#elif 1 && defined(__i386__) +#elif !defined(__CYGWIN__) && defined(__i386__) asm volatile ("661:\n\t" ".byte 0x8d,0x74,0x26,0x00\n" "\n662:\n"