summaryrefslogtreecommitdiff
path: root/sal
AgeCommit message (Collapse)Author
2013-08-15Mark as constTakeshi Abe
Change-Id: Ic7ee570935b5d827dc01a483877ea5021da5abea
2013-08-08Add SDT probes for interning rtl_uStrings.Mark Wielaard
This adds RTL_LOG_STRING_INTERN_NEW and RTL_LOG_STRING_INTERN_DELETE which are connected to SDT probes if available. It introduces two new SDT probes. new_string_intern_16 and delete_string_intern_16 (there is currently no interning for 8-bit rtl_Strings). For consistency both have the same 4 arguments as new_string_(8|16) and delete_string_(8|16). new_string_intern_16 has as 5th argument the address of the original rtl_uString being interned (which may or may not be the same as $arg1). Change-Id: Ib117bba932c1908abc70a7fdd4140c0af76d54cb Reviewed-on: https://gerrit.libreoffice.org/5308 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2013-08-03Add SDT probes for RTL_LOG_STRING_NEW/DELETE.Mark Wielaard
Change-Id: I938259f90aee9d277c9ff5b72c9120b93311cbd3 Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
2013-08-02CFErrorRef is apparently not always initialized by the calleeNorbert Thiebaud
on 10.6 SDK this coredumped in some case in CFRelease(cferror) Maing sure that cferror is initialized to NULL avoid the problem Change-Id: I5624416867670bfd4c8db9b35e3b3d37494f79fd
2013-08-02No self-execing when HAVE_FEATURE_MACOSX_SANDBOX so no need to close fdsTor Lillqvist
Change-Id: Iea03aa4708427772952add0f2fc40012b22e572b
2013-08-01Mark as constTakeshi Abe
Change-Id: Idd1d0641d5b7d8594f354c7d2e2a9093ecc6b2f7
2013-07-31Fix memory leak in osl_getSystemPathFromFileURL.Mark Wielaard
rtl_uStrings should never be directly assigned. That might mess up reference counting. osl_getSystemPathFromFileURL can be called with pustrSystemPath pointing to a non-empty rtl_uStrings. A special case being when the ustrFileURL input and the pustrSystemPath output point to the same rtl_uString instance. So use rtl_uString_assign. Change-Id: I48e17817cba905a4a6d4bc303d072d62941b0d9c Reviewed-on: https://gerrit.libreoffice.org/5209 Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org> Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
2013-07-30Be a bit more lax when resolving bookmarks when sandboxedTor Lillqvist
Change-Id: I6ada3e660ee58f7937425eea40a4bbd82754f4b1
2013-07-29Avoid crash on OS X: guarded fd exceptionTor Lillqvist
On OS X, a file descriptor that shows up as being of type "KQUEUE" in lsof output is apparently created behind the scenes when starting a thread. (Related to BSD kernel event queues: see man kqueue.) When we re-exec ourselves on OS X, and then close all file descriptors >= 3, closing such a KQUEUE fd causes a crash. Guard against this by closing only regular files. Change-Id: I5011bfbaed156b04248b6bddb2a1a58624bee3d4 5011bfbaed156b04248b6bddb2a1a58624bee3d4
2013-07-26fdo#63690 - replace RTL_CONTEXT_ macros with SAL_INFOJelle van der Waa
Change-Id: Ic762d02458265fe1ef2f4ba0b286438b6082e805 Reviewed-on: https://gerrit.libreoffice.org/5120 Reviewed-by: Luboš Luňák <l.lunak@suse.cz> Tested-by: Luboš Luňák <l.lunak@suse.cz>
2013-07-22Fix file_path_helper FPH_LOCAL_DIR_ENTRY.Mark Wielaard
Commit e5e4c54da changed "." to a constant, but the wrong one. Should have been FPH_CHAR_DOT, not FPH_CHAR_PATH_SEPARATOR. Change-Id: I041f6507947f1631f0af133bff0fa3270313391a Reviewed-on: https://gerrit.libreoffice.org/5001 Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org> Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
2013-07-17Fix memory leak with osl_getCurrentSecurity ().Mark Wielaard
The result of osl_getCurrentSecurity () should always be deleted again with osl_freeSecurityHandle (). Change-Id: If0991937fcb24207d1f78166f61c4be22d423629 Reviewed-on: https://gerrit.libreoffice.org/4947 Reviewed-by: David Tardon <dtardon@redhat.com> Tested-by: David Tardon <dtardon@redhat.com>
2013-07-11Uknown -> UnknownCaolán McNamara
Change-Id: I06d48669804d2ae99c47a0df1ed3c6f45c87a57e
2013-07-06Don't use mach_absolute_time(), it gives time since bootTor Lillqvist
Which definitely is not what we want here. Use clock_get_time() on a CALENDAR_CLOCK instead, that gives time since the Unix epoch. So our osl_getSystemTime() had been completely broken on OS X since May 19 (d8d55787b81cdc955b73c8befa4ab608f46e32aa) and no unit test had noticed... Fairly coincidentally, an assert() introduced yesterday in 4d220882b46d5f8edd4d09e5f66722cd296a092e caught it. Change-Id: Iad76a7aadc39159fdc80c99087bb527d6aa49c66
2013-07-05janitorial / stylisticLionel Elie Mamane
Change-Id: I8e7c1e63ff04220e530662d9a6e142f4f0e7247f
2013-07-05API change: osl/time.h take const pointers where appropriateLionel Elie Mamane
Should be backwards-compatible... Change-Id: I6b04bec2c032ff8c57a1b5192b2d3962dcc96c84
2013-07-05API change: oslDateTime signed yearLionel Elie Mamane
Change-Id: Ic4f1e424b130fd2ccca379adbe0a66836b6cac41
2013-07-05sal: add ERROR_SHARING_VIOLATION to win32 error tableMichael Stahl
It's apparently a popular error; map it to E_ACCES which is the same as the catch-all clause does (for compatibility). Change-Id: I55fd932248a2ecbacd4fd6584e92918da95e3cff
2013-07-01Mark as constTakeshi Abe
Change-Id: Ic71f39aaebf07d3b0435882986be71cf2b0390c2
2013-06-27Translate German comments.Chris Hoppe
Change-Id: Ida59dcca7c9a0305aecddaa68f4e585321144458
2013-06-25coverity #982634 and 5 other : Intentional fallthrough in casesNorbert Thiebaud
Change-Id: Ie6cfcc32c1ff80dab0f9835524c89d40503f69f0 Reviewed-on: https://gerrit.libreoffice.org/4498 Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com> Tested-by: Norbert Thiebaud <nthiebaud@gmail.com>
2013-06-25coverity : #984128 and 21 others : Uninitialized scalar fieldNorbert Thiebaud
Change-Id: If801818c2efc8cdec651ff259243075abac41d20 Reviewed-on: https://gerrit.libreoffice.org/4497 Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com> Tested-by: Norbert Thiebaud <nthiebaud@gmail.com>
2013-06-24coverity#706154 : Destination buffer too smallNorbert Thiebaud
Change-Id: I27bc8803353047a057caaf2353f10cdab08e81e9
2013-06-19Fix warning: Value stored is never readTor Lillqvist
Change-Id: Ic41fe1682f19c39faa0a2afc47c11b8a5bead212
2013-06-19Fix warning: Value stored to 'eEncoding' is never readTor Lillqvist
eEncoding is assigned again a few lines below. Change-Id: Ib475095bab30e0c2f066934a10cda650706c2c8a
2013-06-19Add missing break statementsTor Lillqvist
Found by Clang static analyzer: Value stored to 'prio' is never read. Change-Id: I7c0e90e5435b028f0a4b4bded304338cb57271cc
2013-06-19Delete unused sal testsDavid Ostrovsky
Change-Id: Iba1eeb8d8fd0582f216b7552dc9ae21b69e66b4e Reviewed-on: https://gerrit.libreoffice.org/4326 Reviewed-by: Noel Power <noel.power@suse.com> Tested-by: Noel Power <noel.power@suse.com>
2013-06-16Don't use deprecated API for OS X alias resolvingTor Lillqvist
Change-Id: Ifaaec1863f12cd73d0a77c3367935f57675157e2
2013-06-16Indent macxp_resolveAlias() consistentlyTor Lillqvist
Change-Id: I66ab13c4111678f20a09f14126304a0c11116180
2013-06-13Introduce O[U]String::toUInt32Stephan Bergmann
...which has become necessary since bd60d41176da540b01d7583cfe00637431967f39 "Handle oveflow in O(U)String::toInt() functions" reduces values in the range (SAL_MAX_INT32 .. SAL_MAX_UINT32] to zero, but some calls of toInt32(16) relied on getting a correct (unsigned) value for the whole input range ["0" .. "FFFFFFFF"] (see libreoffice-4-1 commit 9bf6c83367cedb7be81bf67f30d2147d26c7a8c3 "Revert overflow checks in O[U]String::toInt{32,64} again"). Audited all uses of toInt32/64 with non-decimal radix. (There is still a TODO comment in oox/source/helper/attributelist.cxx, and stoc/source/typeconv/convert.cxx will still need some love and test code.) Change-Id: Iadaca1c0e41dab553687d0ce41c20c10cd657a95
2013-06-10mingw64: casting to pointer from narrower integer fixes in salFridrich Štrba
Change-Id: I63321e33f92223be47c7ee25dbf03fe3032991d6
2013-06-06fdo#41226 Add error handling of recursed GetCaseCorrectPathNameEx()Isamu Mogi
GetCaseCorrectPathNameEx() with bCheckExistence = true doesn't support windows share path but occasionally it doesn't return failure and returns broken result. For example, when we call with "\\USER-PC\Users\foo" then it converts the path to "\Users\foo". And when "\Users\foo" exists, it returns "\Users\foo". It is caused by missing error handling of searching for file "\\USER-PC". Also similar bug possibly occurs even for local file path. This commit fixes these bugs. Change-Id: Idf1dd1282510d8a6810ed239a83051bb0f8e2f87 Reviewed-on: https://gerrit.libreoffice.org/4151 Reviewed-by: Luboš Luňák <l.lunak@suse.cz> Tested-by: Luboš Luňák <l.lunak@suse.cz>
2013-06-04Don't truncate pointers to 32-bit ints on win64Fridrich Štrba
Change-Id: I5305bf7c82cd3f9f4437de59b53024ef97a7fbc8
2013-05-31rewrite OUString test to not trigger literalalternative plugin warningsLuboš Luňák
Change-Id: Ic359209c44171ab42fa21cd300b433facd3c5ea6
2013-05-20WaE: variable ´res´ set but not usedTor Lillqvist
Change-Id: I5f252f75d22f041c76c7d3cfcdd36f69becf086f
2013-05-20sal osl_getGlobalTimer: Don't confuse start and current time.Mark Wielaard
Change-Id: I575dd70d6b80d4f3279476037e509550cfa23fde Reviewed-on: https://gerrit.libreoffice.org/3979 Reviewed-by: Tor Lillqvist <tml@iki.fi> Tested-by: Tor Lillqvist <tml@iki.fi>
2013-05-20Also iOS has tm_gmtoffTor Lillqvist
Change-Id: Ic0f883672b4bde3142ac257a57464bdbb90df96b
2013-05-20iOS is based on Mach, tooTor Lillqvist
Change-Id: I9b6bdc374c9e92af754094f31e1ff212fb386f9e
2013-05-20Thread-safe version of osl_getGlobalTimeNorbert Thiebaud
Change-Id: Ibb9d23780600437f607d866ff3d396b96879245d Reviewed-on: https://gerrit.libreoffice.org/3960 Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org> Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org> Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
2013-05-15Spelling "separate" (etc) correctly is hardTor Lillqvist
2013-05-14Fix syntax errorTor Lillqvist
Change-Id: I161cf0fb2c5bd071a963ece61928efb7938de6c2
2013-05-14Include PID and TID in SAL_DEBUG outputStephan Bergmann
...and clean up log.cxx somewhat. Change-Id: I657cf6c938cafa61959a8dc59c9f95dba5183d9f
2013-05-13clock_gettime requires -lrt at least on Fedora 18Stephan Bergmann
Change-Id: Id01c86517a89dffd560440d333a37eaa80738b56
2013-05-13Use clock_gettime instead of gettimeofday to have more precise timeArnaud Versini
Change-Id: I8e568368e7626789dee21d4823dbedec6257a231 Reviewed-on: https://gerrit.libreoffice.org/3841 Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com> Tested-by: Norbert Thiebaud <nthiebaud@gmail.com>
2013-05-10soltools: remove Package_inc and empty unistd.h nonsenseMichael Stahl
Change-Id: Ic05de69951b28b9cc8d62f0a534b507c424e6b25
2013-05-06fix typos (wich instead of which)Philipp Riemer
2013-05-06remove usage of RTL_CONSTASCII_USTRINGPARAMLuboš Luňák
Mechanical removal of usage together with OUString ctor, done by compiler plugin. Change-Id: I554227f76df0dac620b1b46fca32516f78b462c5
2013-04-30Move to MPLv2 license headers, with ESC decision and author's permission.Michael Meeks
2013-04-26This *is* C codeTor Lillqvist
Change-Id: I4461b7a38862ad2c9861861fad8d6bf4bafd01ab
2013-04-26fdo#63154: Remove all usages of the macro EXTERN_CMarcos Paulo de Souza
Change-Id: I25b7f509ba5d1007a16c84ad05870a8174c094ec Reviewed-on: https://gerrit.libreoffice.org/3621 Reviewed-by: Tor Lillqvist <tml@iki.fi> Tested-by: Tor Lillqvist <tml@iki.fi> Reviewed-by: David Tardon <dtardon@redhat.com> Tested-by: David Tardon <dtardon@redhat.com>