summaryrefslogtreecommitdiff
path: root/sal/osl/unx
AgeCommit message (Collapse)Author
2018-03-07Intermediate dir may come into existence during osl_createDirectoryPathStephan Bergmann
...when some other entity creates it in parallel. This used to stop creating any subsequent sub-directories in the chain, and instead return a misleading osl_File_E_EXIST. I assume this is the underlying issue of the sporadic Jenkins "Daily Screenshot Build on Windows" failures. (After the previous attempt at getting at that, d15ff312ad80e4d1f210636e3374a81c14c229a2 "Normalize computation of directory and file-in-directory URLs", <https://ci.libreoffice.org/job/lo_tb_master_win_screenshot/333/console> now failed for a different file after all, workdir/screenshots/modules/schart/ui/datarangedialog/DataRangeDialog.png during CppunitTest_chart2_dialogs_test.) Change-Id: I00ee67c1ef634c5390c677693e143c26266eeda7 Reviewed-on: https://gerrit.libreoffice.org/50892 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-03-07Deduplicate includesMike Kaganski
Change-Id: I16a77d0701b42bcf9d751834f0eae4decedd9176 Reviewed-on: https://gerrit.libreoffice.org/50858 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-03-05Make LibreOffice buildable on Haiku.Kacper Kasper
* Obviously VCL wiring is missing, but most components do build. Change-Id: Ie853ada1423a8f4c2b647be59cd47a7730c42978 Reviewed-on: https://gerrit.libreoffice.org/50293 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2018-02-01osl: change osl_psz_removeFile() -> osl_unlinkFile()Chris Sherlock
Also a few cleanups. Change-Id: I3269d623917efda3a873f745dbce8bb25dce79be Reviewed-on: https://gerrit.libreoffice.org/48792 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-25Remove stdlib.h from sal/config.hStephan Bergmann
This reverts 5da3337c007e0572028283d70bad43e9a29d45c1 "readded include stdlib.h, because of missing NULL definition in many headers, #100000, #101685", which is no longer relevant. Change-Id: I544ed9a7afbf7b611bc481b8d50acca3193d93de Reviewed-on: https://gerrit.libreoffice.org/48131 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
2018-01-25Fix typosAndrea Gelmini
Change-Id: Ieef0e3f21eb12cb5b72d39da4bc0a8c60dd0d5ce Reviewed-on: https://gerrit.libreoffice.org/48545 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2018-01-23Silence upcoming GCC 8 -Werror=sizeof-pointer-memaccessStephan Bergmann
...("error: argument to ‘sizeof’ in ‘char* strncpy(char*, const char*, size_t)’ call is the same expression as the source; did you mean to use the size of the destination?") in a place where the use of strncpy instead of strcpy (introduced with 9276f7d5740a28b342db2a9bcd8644ff2f4f5742 "fdo#32263") doesn't help prevent any buffer overflows anyway (the target's size already having been checked to be sufficiently large). Change-Id: I70773538f4092f1306fb00f1fa7f9138e06894e5 Reviewed-on: https://gerrit.libreoffice.org/48391 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-01-20More loplugin:cstylecast on macOSStephan Bergmann
Automatic rewrite (of loplugin:cstylecast and loplugin:unnecessaryparen) after cab0427cadddb3aaf1349c66f2fa13a4234ba4b2 "Enable loplugin:cstylecast for some more cases" and a409d32e7f6fc09e041079d6dbc3c927497adfed "More loplugin:cstylecast" Change-Id: Iff4877e8a42804c952c48c13332caf0a83c92870 Reviewed-on: https://gerrit.libreoffice.org/48216 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-01-19Remove include of config_global.h from sal/config.hStephan Bergmann
(where it is not actually needed), and instead include it where needed Change-Id: I107f8d4002d3001393b89834dd30a30b0c53a792 Reviewed-on: https://gerrit.libreoffice.org/48152 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
2018-01-15More loplugin:cstylecast: salStephan Bergmann
Change-Id: I1ca982dc8c35c7a2762572d7bb47066ead8e6c89
2018-01-15fix android buildNoel Grandin
Change-Id: Id53f9d2a5adf126db9abeab620bb92b8720425f7
2018-01-15convert a<b?a:b to std::min(a,b)Noel Grandin
with something like git grep -nP '(.*)\s*<\s*(.*)\s*\?\s*\g1\s*:\s*\g2' -- *.?xx Change-Id: Id5078b35961847feb78a66204fdb7598ee63fd23 Note: we also convert a>b?b:a Reviewed-on: https://gerrit.libreoffice.org/47736 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-12More loplugin:cstylecast: salStephan Bergmann
auto-rewrite with <https://gerrit.libreoffice.org/#/c/47798/> "Enable loplugin:cstylecast for some more cases" plus solenv/clang-format/reformat-formatted-files Change-Id: I7d89b011464ba5d2dd12e04d5fc9f65cb4daebde
2017-12-15loplugin:salcall (macOS)Stephan Bergmann
Change-Id: I297ac09358ce948acae9b73e8ed605964520c73b Reviewed-on: https://gerrit.libreoffice.org/46437 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-12-11loplugin:salcall fix functionsNoel Grandin
since cdecl is the default calling convention on Windows for such functions, the annotation is redundant. Change-Id: I1a85fa27e5ac65ce0e04a19bde74c90800ffaa2d Reviewed-on: https://gerrit.libreoffice.org/46164 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-04Condition for definition of LastIdent must match condition for its useStephan Bergmann
Change-Id: Iccc58d396d8c80a717e9d33ed8d872aadea08afa Reviewed-on: https://gerrit.libreoffice.org/45829 Reviewed-by: Rene Engelhard <rene@debian.org> Tested-by: Rene Engelhard <rene@debian.org>
2017-12-04new loplugin salcall: remove unnecessary SAL_CALLNoel Grandin
In this first commit, I use the plugin to verify the consistency of our SAL_CALL annotations. The point being to make the next commit more mechanical in nature, purely using the rewriter. There are various chunks of unix-only code that have never had to be compiled by MSVC, hence the inconsistencies. In bridges, I had to inline some typedefs to make the verification code happy, since it cannot see into typedefs. Change-Id: Iec6e274bed857febf7295cfcf5e9f21fe4a34da0 Reviewed-on: https://gerrit.libreoffice.org/45502 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-30loplugin:unnecessaryparen: signed numeric literalsStephan Bergmann
Change-Id: I75c8224452ca9c3711a2ccaca9ecf549fa59cb64 Reviewed-on: https://gerrit.libreoffice.org/45549 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-11-30sal: check for HAVE_GCC_BUILTIN_ATOMIC only once in interlckMiklos Vajna
Change-Id: Iaddc79cee0c06f72f636a3d35959922fd78f4e20
2017-11-28Revert loplugin:unnecessaryparen warning around integer literalsStephan Bergmann
...as those may be used to silence Clang -Werror,-Wunreachable-code (as happens in sal/osl/unx/file_volume.cxx for Android, where OSL_detail_STATFS(...) always expands to (1)). Change-Id: I85d280c1315b4447362255d17f13f437d3c4af92
2017-11-27loplugin:unnecessaryparen: Warn about parentheses around literalsStephan Bergmann
...that are not composed of multiple tokens, like ("foo" "bar"). Also don't yet warn about Boolean literals, which are sometimes wrapped in parentheses to silence unreachable-code warnings. To avoid multiple warnings about code like f((0)) switch to generally using a set of ParenExpr to keep track of which occurrences have already been handled. Change-Id: I036a25a92836ec6ab6c56ea848f71bc6d63822bc Reviewed-on: https://gerrit.libreoffice.org/45317 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-11-23loplugin:simplifybool for negation of comparison operatorNoel Grandin
Change-Id: Ie56daf560185274754afbc7a09c432b5c2793791 Reviewed-on: https://gerrit.libreoffice.org/45068 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-22Make loplugin:unnecessaryparen warn about (x) ? ... : ... after allStephan Bergmann
...which had been left out because "lots of our code uses this style, which I'm loathe to bulk-fix as yet", but now in <https://gerrit.libreoffice.org/#/c/45060/1/> "use std::unique_ptr" would have caused an otherwise innocent-looking code change to trigger a loplugin:unnecessaryparen warning for pFormat = (pGrfObj) ? ... (barring a change to ignoreAllImplicit in compilerplugins/clang/unnecessaryparen.cxx similar to that in <https://gerrit.libreoffice.org/#/c/45083/2> "Make not warning about !! in loplugin:simplifybool consistent", which should also have caused the warning to disappear for the modified code, IIUC). Change-Id: I8bff0cc11bbb839ef06d07b8d9237f150804fec2 Reviewed-on: https://gerrit.libreoffice.org/45088 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-11-02Avoid warning thrashStephan Bergmann
...between "error: unannotated fall-through between switch labels [-Werror,-Wimplicit-fallthrough]" (in some builds, for the original code) and "error: fallthrough annotation in unreachable code [-Werror,-Wimplicit-fallthrough]" (in other builds, after adding SAL_FALLTHROUGH). Change-Id: I75bbefd69c81f43f22117f8ad110237de24e18af
2017-11-02Clean up oslTranslateFileErrorStephan Bergmann
Change-Id: I004bcba518ead9c149f1671d62aa94986a38945d
2017-11-02coverity#1420539: dead codeStephan Bergmann
...after 0b413caadfbe68b278ca5ba33b6d204687586ea9 "loplugin:constantparam in sal,sax" Change-Id: Idf000bd1e0a261eac9ec0afbd2fb6f4c4ef8c7dc
2017-10-31loplugin:constantparam in sal,saxNoel Grandin
Change-Id: I7ca2fd05d1cf61f9038c529a853e72fedb1c9ed0 Reviewed-on: https://gerrit.libreoffice.org/44087 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-10-29tdf#94695 Replace gethostbyaddr with getnameinfoArkadiy Illarionov
Change-Id: I7ac99a6f470998364e9e43b749a0914d8a3fc096 Reviewed-on: https://gerrit.libreoffice.org/42769 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-10-26cid#1420316: Try silence CONSTANT_EXPRESSION_RESULTStephan Bergmann
(or does the comment need to go exactly at the line before the one containing the "return" token?) Change-Id: I5f92e59ee05d0b5ba3d6bda775e6ca02f185dbe8
2017-10-25Also check whether negative uOffset exceeds std::numeric_limits<off_t>::min()Stephan Bergmann
...in the one case where uOffset is of signed type sal_Int64 Change-Id: I626f747f70fb720bcc5a4ee10fbce30fc0673ae9
2017-10-24loplugin:includeform: sal (macOS)Stephan Bergmann
Change-Id: Ic4d73e1fc328aecd897163b71edf0b4c9b8a090b
2017-10-23loplugin:includeform: salStephan Bergmann
Change-Id: I539ca8b9dee5edc5fc2282a2b9b0ffd78bad8b11
2017-10-20coverity#1419948 silence Operands don't affect resultCaolán McNamara
Change-Id: I68c42f6d9c6cfda90446a07ecd6bbf02abb22af9 Reviewed-on: https://gerrit.libreoffice.org/43593 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-10-16Rephrase checks for exceeding off_t limitsStephan Bergmann
...in a way that, by using a function template, avoids new Clang 6 -Werror,-Wtautological-constant-compare when sal_Int64 and off_t are the same type. Change-Id: I06d4feb8ba8cb163e5208f107c28959755ff5633
2017-10-16Fix overflowStephan Bergmann
Change-Id: I1ddd1f7d749a99395fbd7be433db5884536bf7a7
2017-10-03new loplugin:blockblockNoel Grandin
Change-Id: I7b68b70fa4c7234e8882f7627026959a596968fd Reviewed-on: https://gerrit.libreoffice.org/43025 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-09-18The '<= 0' check can go nowStephan Bergmann
...after 0083b33650c2f584ceff6eeaf9ef6993bfe0ae9b "sal: -Werror,-Wsign-compare (32-bit)" cast the check against SAL_MAX_UINT32 to unsigned, anyway. (And the check for == 0 is already handled in the platform-generic part below.) Change-Id: I0d0354cb9368bffef5d3aa835f865524d106a6f3
2017-09-18sal: -Werror,-Wsign-compare (32-bit)Michael Stahl
Change-Id: I204716eea112a1c99f6ac4df0d138c4c7d8b68e3
2017-09-15Use the system TID as the thread identifierJan-Marek Glogowski
This uses the system TID as the LO thread identifier for Linux, IOS and macOS, just as the Windows backend already does. While at it use pthread functions on Linux, FreeBSD and MacOS to set the thread name. We already depend on MacOS 10.6 for dispatch support and Linux supports pthread_setname_np since glibc 2.12, which is included in our baseline. SYS_gettid is available since Linux 2.4.11. I just copied the FreeBSD info from stackoverflow, while at it. Change-Id: I39cdd09e952c0a2286d39f938c64b2d2d2f1ef91 Reviewed-on: https://gerrit.libreoffice.org/42071 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Jenkins <ci@libreoffice.org>
2017-09-15Assert flags passed to rtl_convertTextToUnicode/UnicodeToText are validStephan Bergmann
...so that at least some typos of using OUSTRING_TO_OSTRING_CVTFLAGS (0x566) instead of OSTRING_TO_OUSTRING_CVTFLAGS (0x333) can be found. (Unfortunately, in the other direction, 0x333 is a valid combination of RTL_UNICODETOTEXT_FLAGS_*.) Change-Id: I7cfb3677b103ae90de88833cc93b0a5384607e15 Reviewed-on: https://gerrit.libreoffice.org/42288 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-09-13Silence -Werror,-Wunreachable-code on AndroidStephan Bergmann
Change-Id: Ide7591b4012f23e8a3faa705537937efcac435a2
2017-09-06Clean up sal/backtrace.hxxStephan Bergmann
Change-Id: Id78e9c0ca29ff2e52591f3d446431ac23c20ab7a Reviewed-on: https://gerrit.libreoffice.org/41926 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-08-28Fix type of errno/WSAGetLastError()Stephan Bergmann
...as got broken with 3d5be8cd31bcf6fce8772133298d2ae076361362 "osl: give warning on socket error (win32), move Flag definition (unx)" Change-Id: Ib68540596b0bc2cda3e809e765c7d41ca45dda71
2017-08-28osl: cleanup osl_(acquire|release|close)SocketChris Sherlock
Change-Id: Ifc0b88963bcd28e5709accdf892b2cb16b2b55eb
2017-08-27osl: give warning on socket error (win32), move Flag definition (unx)Chris Sherlock
Change-Id: I34b773f32a055dfe85ec9c42e72a9f51ee8fea10 Reviewed-on: https://gerrit.libreoffice.org/41610 Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com> Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
2017-08-27osl: remove commented out reversemap functionsChris Sherlock
Change-Id: I0354cf98ba3804505970e881dfff45a4d9a227da Reviewed-on: https://gerrit.libreoffice.org/41609 Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com> Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
2017-08-27osl: remove extraneous comment cruft from socket.cxxChris Sherlock
Change-Id: I6979493a629874ab38629b655c47c299b24abdcd Reviewed-on: https://gerrit.libreoffice.org/41608 Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com> Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
2017-08-18Fix typosAndrea Gelmini
Change-Id: I795059109e23800987cda6f04c58ab18c488ad07 Reviewed-on: https://gerrit.libreoffice.org/41242 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2017-08-17Fix typosAndrea Gelmini
Change-Id: Iaa9c0aea3ea1a239e378bd714ba335f91bb1faf3 Reviewed-on: https://gerrit.libreoffice.org/41194 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
2017-08-17Remove excess SAL_WARNsStephan Bergmann
Each such precondition violation for that URE API function would already result in osl_File_E_INVAL anyway. Change-Id: I279949ae8f341e6272bb4574da712fd693461acd