]> granicus.if.org Git - psmisc/commitdiff
Patch to make against cygwin
authorCraig Small <csmall@users.sourceforge.net>
Mon, 25 Jul 2011 11:42:42 +0000 (21:42 +1000)
committerCraig Small <csmall@users.sourceforge.net>
Mon, 25 Jul 2011 11:42:42 +0000 (21:42 +1000)
ChangeLog
configure.ac
src/Makefile.am
src/fuser.c
src/lists.h

index 4605f7feafc953e57a6e17163be9f578476d2bea..4217a09f50b3b5feb45558e50dbf107b1f47c678 100644 (file)
--- 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
 ================
index e8480cb9e6ad482454e4475cc86d8393cf281de8..61779751c8e67561907c855dbb17ab483bf95088 100644 (file)
@@ -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
index 7cff9fd9cfac9b94ea2aec7a636410518a8c3960..43986317781b19c4c02dc3b659d1b2b27128477a 100644 (file)
@@ -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 
index bef14e20f02c21d05daf90a48f4b60069ba34596..476fdf170121b21a81ad37851e4f13241d56b091 100644 (file)
 #include <signal.h>
 #include <getopt.h>
 #include <setjmp.h>
+#include <limits.h>
+/* 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;
index d91bbdf8947842c5925a1fb1a460f9255a61007f..01c6648cfe28a8e947bbe856529d180fb49e0025 100644 (file)
@@ -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"