[PATCH v4 0/2] Don't call exit in the shared library.

Jens Reyer jre.winesim at gmail.com
Tue Oct 11 09:21:02 CDT 2016


v1: use asserts for mmap failure modes
    https://www.winehq.org/pipermail/wine-devel/2014-December/106096.html
v2: use abort instead of exit for shared library failure modes
    https://www.winehq.org/pipermail/wine-devel/2015-July/108555.html
v3: rebase v2, split commits per file
v4: Drop all changes that don't trigger the lintian warning.

This includes dropping the wrong ones pointed out by Sebastian
Lackner (Thanks a lot! Note however that it always compiled just
fine with these changes) and the rejected ones for wpp (I assume
they are not related to the shared library).

For dropping the other changes I completely relied on the lintian
tool, but can't really judge if dropping them is the right thing
to do. I attach them to this mail (PATCH v4 0/2) to ease
commenting on them (but not as patch submission for now). Any
feedback would be helpful for progressing in Debian with this. In
the end I'd like to have any issues related to this topic solved
and completely drop that patch in Debian.

Thanks in advance!
jre

diff --git a/libs/port/spawn.c b/libs/port/spawn.c
index 97364e7..7bc1ba4 100644
--- a/libs/port/spawn.c
+++ b/libs/port/spawn.c
@@ -62,13 +62,13 @@ int _spawnvp(int mode, const char *cmdname, const char *const argv[])
 
         signal( SIGPIPE, SIG_DFL );
         execvp(cmdname, (char **)argv);
-        _exit(1);
+        abort();
     }
 
     if (pid == -1)
         return -1;
 
-    if (mode == _P_OVERLAY) exit(0);
+    if (mode == _P_OVERLAY) abort();
 
     if (mode == _P_WAIT || mode == _P_DETACH)
     {
diff --git a/libs/wine/ldt.c b/libs/wine/ldt.c
index 0946407..8bdda00 100644
--- a/libs/wine/ldt.c
+++ b/libs/wine/ldt.c
@@ -192,7 +192,7 @@ static int internal_set_entry( unsigned short sel, const LDT_ENTRY *entry )
         {
             perror("i386_set_ldt");
             fprintf( stderr, "Did you reconfigure the kernel with \"options USER_LDT\"?\n" );
-            exit(1);
+            abort();
         }
     }
 #elif defined(__svr4__) || defined(_SCO_DS)
@@ -213,7 +213,7 @@ static int internal_set_entry( unsigned short sel, const LDT_ENTRY *entry )
         perror("i386_set_ldt");
 #else
     fprintf( stderr, "No LDT support on this platform\n" );
-    exit(1);
+    abort();
 #endif
 
     if (ret >= 0)
diff --git a/libs/wine/mmap.c b/libs/wine/mmap.c
index 1a3ca59..83e6a86 100644
--- a/libs/wine/mmap.c
+++ b/libs/wine/mmap.c
@@ -76,7 +76,7 @@ static inline int get_fdzero(void)
         if ((fd = open( "/dev/zero", O_RDONLY )) == -1)
         {
             perror( "/dev/zero: open" );
-            exit(1);
+            abort();
         }
     }
     return fd;
@@ -128,7 +128,7 @@ static int try_mmap_fixed (void *addr, size_t len, int prot, int flags,
     if ( (pid = vfork()) == -1 )
     {
         perror("try_mmap_fixed: vfork");
-        exit(1);
+        abort();
     }
     if ( pid == 0 )
     {
-- 
2.9.3




More information about the wine-patches mailing list