[PATCH v3 0/6] Don't call exit in the shared library.

Jens Reyer jre.winesim at gmail.com
Fri Oct 7 11:39:20 CDT 2016


Hi,

this patch series replaces calls of "exit" in the shared library
with "abort" for failures, and "break" or "return" for
non-failures.

We were hinted to this in Debian by the QA tool lintian
(https://lintian.debian.org/tags/shlib-calls-exit.html):

  The shared library libwine.so.1.0 calls the C library exit() or
  _exit() functions.

  In the case of an error, the library should instead return an
  appropriate error code to the calling program which can then
  determine how to handle the error, including performing any
  required clean-up.

  In most cases, removing the call should be discussed with
  upstream, particularly as it may produce an ABI change.

We apply this patch in its current form since Wine 1.7.44, and
I'm not aware of any issues. At the same time I admit, that I don't
grasp it totally, e.g. the changes in libport and wpp don't seem to
be necessary to avoid the lintian hint.

I welcome any feedback and review.

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

I'm submitting this on behalf of its original author Michael Gilbert.
It's part of Debian's packaging and licensed LGPL-2.1+.

Michael Gilbert (6):
  libport: Don't call exit in the shared library.
  libwine: Don't call exit in the shared library.
  libwine: Don't call exit in the shared library.
  libwine: Don't call exit in the shared library.
  libwine: Don't call exit in the shared library.
  wpp: Don't call exit in the shared library.

 libs/port/spawn.c  |  8 ++++----
 libs/wine/config.c |  4 ++--
 libs/wine/debug.c  |  2 +-
 libs/wine/ldt.c    |  4 ++--
 libs/wine/mmap.c   | 10 +++++-----
 libs/wpp/preproc.c |  4 ++--
 6 files changed, 16 insertions(+), 16 deletions(-)

-- 
2.9.3



More information about the wine-patches mailing list