summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabor Kelemen <gabor.kelemen.extern@allotropia.de>2023-08-04 15:02:02 +0200
committerThorsten Behrens <thorsten.behrens@allotropia.de>2023-08-09 23:58:47 +0200
commit218a7650a5cf03f895bed19c68d6f02daec536e9 (patch)
treedfad4f68fb86a85b67cf36992ba2136c7494e298
parentc1d690d8c478a9d2692a89cbb982b59df5438972 (diff)
tdf#146619 Remove unused includes from sal/ [system.hxx]
Change-Id: I30f3ce338e86f1a6dad5e16023ce4c883079fbcc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155351 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
-rw-r--r--sal/IwyuFilter_sal.yaml8
-rw-r--r--sal/osl/unx/file.cxx2
-rw-r--r--sal/osl/unx/file_misc.cxx2
-rw-r--r--sal/osl/unx/file_stat.cxx1
-rw-r--r--sal/osl/unx/module.cxx2
-rw-r--r--sal/osl/unx/pipe.cxx3
-rw-r--r--sal/osl/unx/process.cxx5
-rw-r--r--sal/osl/unx/profile.cxx6
-rw-r--r--sal/osl/unx/random.cxx2
-rw-r--r--sal/osl/unx/readwrite_helper.cxx1
-rw-r--r--sal/osl/unx/security.cxx2
-rw-r--r--sal/osl/unx/signal.cxx3
-rw-r--r--sal/osl/unx/socket.cxx5
-rw-r--r--sal/osl/unx/sockimpl.hxx2
-rw-r--r--sal/osl/unx/system.hxx32
-rw-r--r--sal/osl/unx/tempfile.cxx1
-rw-r--r--sal/osl/unx/thread.cxx1
-rw-r--r--sal/osl/unx/uunxapi.cxx3
18 files changed, 48 insertions, 33 deletions
diff --git a/sal/IwyuFilter_sal.yaml b/sal/IwyuFilter_sal.yaml
index 4337fa73b4c3..325aba8552c4 100644
--- a/sal/IwyuFilter_sal.yaml
+++ b/sal/IwyuFilter_sal.yaml
@@ -3,4 +3,10 @@ assumeFilename: sal/osl/all/log.cxx
excludelist:
sal/osl/all/log.cxx:
#sal_use_syslog required from this file
- - salusesyslog.hxx \ No newline at end of file
+ - salusesyslog.hxx
+ sal/osl/unx/system.hxx:
+ # needed for the define pthread_testcancel() to work
+ - pthread.h
+ sal/android/uthash.h:
+ # needed for defines to work / somehow on Linux there is a warning about android-related file
+ - string.h
diff --git a/sal/osl/unx/file.cxx b/sal/osl/unx/file.cxx
index a39365b9b115..3bdb4a50b05a 100644
--- a/sal/osl/unx/file.cxx
+++ b/sal/osl/unx/file.cxx
@@ -43,8 +43,10 @@
#include <cassert>
#include <limits>
+#include <dirent.h>
#include <string.h>
#include <pthread.h>
+#include <sys/file.h>
#include <sys/mman.h>
#if defined(MACOSX)
diff --git a/sal/osl/unx/file_misc.cxx b/sal/osl/unx/file_misc.cxx
index 01842dc73154..8e079fe44e42 100644
--- a/sal/osl/unx/file_misc.cxx
+++ b/sal/osl/unx/file_misc.cxx
@@ -43,6 +43,8 @@
#include <stdio.h>
#include <string.h>
#include <unistd.h>
+#include <utime.h>
+#include <sys/file.h>
#include <sys/stat.h>
#include <sys/mman.h>
diff --git a/sal/osl/unx/file_stat.cxx b/sal/osl/unx/file_stat.cxx
index 3b702905cb99..f19b177fff23 100644
--- a/sal/osl/unx/file_stat.cxx
+++ b/sal/osl/unx/file_stat.cxx
@@ -25,6 +25,7 @@
#include <errno.h>
#include <limits.h>
#include <unistd.h>
+#include <utime.h>
#include <osl/diagnose.h>
#include <osl/thread.h>
diff --git a/sal/osl/unx/module.cxx b/sal/osl/unx/module.cxx
index 3eabc6294f83..532633f31d28 100644
--- a/sal/osl/unx/module.cxx
+++ b/sal/osl/unx/module.cxx
@@ -28,6 +28,8 @@
#include <rtl/string.hxx>
#include <rtl/ustring.hxx>
#include <assert.h>
+#include <dlfcn.h>
+#include <dirent.h>
#include "system.hxx"
#include "file_url.hxx"
diff --git a/sal/osl/unx/pipe.cxx b/sal/osl/unx/pipe.cxx
index 45d31e00826b..b4d0f09fd3d4 100644
--- a/sal/osl/unx/pipe.cxx
+++ b/sal/osl/unx/pipe.cxx
@@ -35,6 +35,9 @@
#include <cassert>
#include <cstring>
+#include <sys/file.h>
+#include <sys/stat.h>
+#include <unistd.h>
constexpr OStringLiteral PIPEDEFAULTPATH = "/tmp";
constexpr OStringLiteral PIPEALTERNATEPATH = "/var/tmp";
diff --git a/sal/osl/unx/process.cxx b/sal/osl/unx/process.cxx
index 7d6936265c0b..4e06d6369108 100644
--- a/sal/osl/unx/process.cxx
+++ b/sal/osl/unx/process.cxx
@@ -21,6 +21,11 @@
#include <rtl/ustring.hxx>
#include <cassert>
+#include <dirent.h>
+#include <sys/file.h>
+#include <sys/time.h>
+#include <sys/wait.h>
+#include <unistd.h>
/*
* ToDo:
diff --git a/sal/osl/unx/profile.cxx b/sal/osl/unx/profile.cxx
index 354fe626f390..881e66d5ce40 100644
--- a/sal/osl/unx/profile.cxx
+++ b/sal/osl/unx/profile.cxx
@@ -29,6 +29,12 @@
#include <rtl/alloc.h>
#include <sal/log.hxx>
+#include <dirent.h>
+#include <sys/file.h>
+#include <sys/stat.h>
+#include <sys/un.h>
+#include <unistd.h>
+
#define LINES_INI 32
#define LINES_ADD 10
#define SECTIONS_INI 5
diff --git a/sal/osl/unx/random.cxx b/sal/osl/unx/random.cxx
index 260aa61ba8a4..7c76fed9498d 100644
--- a/sal/osl/unx/random.cxx
+++ b/sal/osl/unx/random.cxx
@@ -11,6 +11,8 @@
#include <oslrandom.h>
#include <assert.h>
+#include <sys/file.h>
+#include <unistd.h>
int osl_get_system_random_data(char* buffer, size_t desired_len)
{
diff --git a/sal/osl/unx/readwrite_helper.cxx b/sal/osl/unx/readwrite_helper.cxx
index 49c44c2c097b..48330b4bde03 100644
--- a/sal/osl/unx/readwrite_helper.cxx
+++ b/sal/osl/unx/readwrite_helper.cxx
@@ -13,6 +13,7 @@
#include <cassert>
#include <cstddef>
#include <limits>
+#include <unistd.h>
#include "readwrite_helper.hxx"
diff --git a/sal/osl/unx/security.cxx b/sal/osl/unx/security.cxx
index b15ec9e773b0..9747fe92ea81 100644
--- a/sal/osl/unx/security.cxx
+++ b/sal/osl/unx/security.cxx
@@ -23,6 +23,8 @@
#include <cstddef>
#include <cstring>
#include <limits>
+#include <sys/stat.h>
+#include <unistd.h>
#ifdef IOS
#include <premac.h>
diff --git a/sal/osl/unx/signal.cxx b/sal/osl/unx/signal.cxx
index 91cf59ff1db1..8fcfbc534ec5 100644
--- a/sal/osl/unx/signal.cxx
+++ b/sal/osl/unx/signal.cxx
@@ -49,6 +49,9 @@
#include <valgrind/memcheck.h>
#endif
+#include <sys/wait.h>
+#include <unistd.h>
+
namespace
{
extern "C" using Handler1 = void (*)(int);
diff --git a/sal/osl/unx/socket.cxx b/sal/osl/unx/socket.cxx
index 535c1727cb15..5573ca275afc 100644
--- a/sal/osl/unx/socket.cxx
+++ b/sal/osl/unx/socket.cxx
@@ -38,7 +38,12 @@
#include "unixerrnostring.hxx"
#include <oslsocket.hxx>
+#include <arpa/inet.h>
+#include <netdb.h>
+#include <netinet/tcp.h>
#include <poll.h>
+#include <sys/file.h>
+#include <unistd.h>
/* defines for shutdown */
#define SD_RECEIVE 0
diff --git a/sal/osl/unx/sockimpl.hxx b/sal/osl/unx/sockimpl.hxx
index 1a9bc1f9ede2..4a67df4f1f72 100644
--- a/sal/osl/unx/sockimpl.hxx
+++ b/sal/osl/unx/sockimpl.hxx
@@ -26,6 +26,8 @@
#include "system.hxx"
+#include <sys/un.h>
+
#if defined(LINUX) || defined(FREEBSD) || defined(NETBSD)
#define CLOSESOCKET_DOESNT_WAKE_UP_ACCEPT 1
#endif
diff --git a/sal/osl/unx/system.hxx b/sal/osl/unx/system.hxx
index f70887c8c42f..8601850a1309 100644
--- a/sal/osl/unx/system.hxx
+++ b/sal/osl/unx/system.hxx
@@ -19,27 +19,7 @@
#pragma once
-#include <stdio.h>
-#include <stdlib.h>
-#include <limits.h>
-#include <string.h>
#include <errno.h>
-#include <stdarg.h>
-
-#include <unistd.h>
-#include <fcntl.h>
-#include <dirent.h>
-#include <signal.h>
-#include <utime.h>
-
-#include <pwd.h>
-
-#include <netdb.h>
-
-#include <sys/stat.h>
-#include <sys/wait.h>
-
-#include <sys/types.h>
/* Make sockets of type AF_UNIX use underlying FS rights */
#if defined(__sun) && !defined(_XOPEN_SOURCE)
@@ -50,9 +30,6 @@
# include <sys/socket.h>
#endif
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
#ifdef SYSV
# include <sys/utsname.h>
#endif
@@ -62,16 +39,7 @@
# define __USE_GNU
# endif
-# include <shadow.h>
# include <pthread.h>
-# include <sys/file.h>
-# include <sys/ioctl.h>
-# include <sys/uio.h>
-# include <sys/un.h>
-# include <netinet/tcp.h>
-# include <dlfcn.h>
-# include <endian.h>
-# include <sys/time.h>
# define IORESOURCE_TRANSFER_BSD
# define IOCHANNEL_TRANSFER_BSD_RENO
# define pthread_testcancel()
diff --git a/sal/osl/unx/tempfile.cxx b/sal/osl/unx/tempfile.cxx
index 29a4d453f80c..dbafe2fae297 100644
--- a/sal/osl/unx/tempfile.cxx
+++ b/sal/osl/unx/tempfile.cxx
@@ -22,6 +22,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/time.h>
+#include <unistd.h>
#include "system.hxx"
#include <osl/file.h>
#include <osl/thread.h>
diff --git a/sal/osl/unx/thread.cxx b/sal/osl/unx/thread.cxx
index ee34731a4456..804ac6ec2a1e 100644
--- a/sal/osl/unx/thread.cxx
+++ b/sal/osl/unx/thread.cxx
@@ -24,6 +24,7 @@
#include <limits>
#include <functional>
#include <mutex>
+#include <unistd.h>
#include "system.hxx"
#include "unixerrnostring.hxx"
diff --git a/sal/osl/unx/uunxapi.cxx b/sal/osl/unx/uunxapi.cxx
index d1fc6c4f9d3f..bdfed5d1ebad 100644
--- a/sal/osl/unx/uunxapi.cxx
+++ b/sal/osl/unx/uunxapi.cxx
@@ -31,6 +31,9 @@
#include <osl/thread.h>
#include <sal/log.hxx>
+#include <sys/file.h>
+#include <utime.h>
+
#ifdef ANDROID
#include <osl/detail/android-bootstrap.h>
#endif