Commit Graph

46 Commits (bf347d15804c27348c84a55ab763f89b718e8aac)

Author SHA1 Message Date
Frederick Martian f58a7c7673 Make changes according to recommendations by Copilot
- correction spelling of suppress_error
- improved error handling in remove() based on functionality in get_fileattr() and somewhat changed error handling in get_fileattr() itself
- call explicitly LLFile::fopen() to make sure we use the correct file path conversion under Windows

Removing Flawfinder comments since Flawfinder isn't used in the viewer anymore
Adding an option to support symlink detection in getattr()
Adding comments to function implementation to indicate that they are really static functions of the LLFile class
2025-10-21 00:50:27 +03:00
RolfKal 2adf1bbdcb Remove trailing space 2025-10-21 00:50:27 +03:00
RolfKal 49a850ccc1 Remove a trailing space and a missed LLFile::remove() call right before the LLFile::rename() 2025-10-21 00:50:27 +03:00
RolfKal e12958161c Improve LLFile to be consistent between Windows and Linux/Mac 2025-10-21 00:50:27 +03:00
Ansariel Hiller d6190bbf13
Refactor LLFileSystem for and fix an old issue in LLFile (#2332) 2024-08-19 09:39:35 +03:00
Alexander Gavriliuk 2ea5ac0c43 #1111 Remove xmlrpc-epi 2024-07-01 20:20:04 +02:00
Ansariel cb3bd8865a Fix a bunch of uninitialized variable warnings that showed up in Visual Studio 2024-05-30 15:41:36 +02:00
Andrey Lihatskiy 1b68f71348 #824 Process source files in bulk: replace tabs with spaces, convert CRLF to LF, and trim trailing whitespaces as needed 2024-04-29 07:56:09 +03:00
Nat Goodspeed 9f446be76e DRTVWR-476: Add LLUniqueFile, adding RAII semantics to LLFILE*.
LLUniqueFile wraps an LLFILE* in a move-only class that closes the wrapped
LLFILE* on destruction. It provides conversion operators to permit idiomatic
usage as an LLFILE* value.
2020-03-25 19:05:17 -04:00
andreykproductengine 66502df050 MAINT-8540 Eliminated a lot of xui related log warnings on startup and opening preferences 2018-04-20 20:21:20 +03:00
Nat Goodspeed 5002bf5660 MAINT-8087: Use env vars from VMP for AppData\Roaming and Local.
On Windows, when logged in with a non-ASCII username, every one of the three
documented APIs -- SHGetSpecialFolderPath(), SHGetFolderPath() and
SHGetKnownFolderPath() -- fails to retrieve any pathname at all. We cannot
account for the fact that the oldest of these continues to work with the
release viewer and within a Python script (though not, curiously, from a
Python interactive session). With a non-ASCII username, they consistently fail
when called from an Alex Ivy viewer build: "The filename, directory name, or
volume label syntax is incorrect."

Empirically, with a non-ASCII username, the preset APPDATA and LOCALAPPDATA
environment variables are also useless, e.g. c:\Users\??????\AppData\Roaming
where those are, yup, actual question marks.

Empirically, the VMP is able to successfully call SHGetFolderPath() to
retrieve both AppData\Roaming and AppData\Local. Therefore, we make the VMP
set the APPDATA and LOCALAPPDATA environment variables to the UTF-8 encoded
correct pathnames. Instead of calling SHGetSomethingFolderPath() at all, make
LLDir_Win32 retrieve those environment variables.

Make LLFile::mkdir() treat "directory already exists" as a success case. Every
single call fell into one of two categories: either it didn't check success at
all, or it tested specially to exempt errno == EEXIST. Migrate that test into
mkdir(); eliminate it from call sites.

Make LLDir::append() and add() convenience functions accept variadic
arguments. Replace add(add()...) constructs, as well as clumsy concatenations
of directory names and getDirDelimiter(), with simple variadic add() calls.
2017-12-20 22:51:26 -05:00
Nat Goodspeed 434f0e161a Automated merge with ssh://bitbucket.org/lindenlab/viewer-release 2017-02-03 09:54:52 -05:00
Nat Goodspeed 548f59042f DRTVWR-418: libc++ has stat data in <sys/types.h>. 2016-11-22 08:40:41 -05:00
andreykproductengine 759b4f14d8 MAINT-6828 Removed unnessesary spam in logs 2016-10-13 22:49:06 +03:00
Oz Linden c8726aba30 remove execute permission from many files that should not have it 2015-11-10 09:48:56 -05:00
Nat Goodspeed cc587b9ef9 MAINT-4744: remove nonstandard #include from llfile.h.
Changeset ffd264ca493c removed the whole llstdio_filebuf construct, which is
what depended on the __gnu_cxx::stdio_filebuf<> extension. Now, even on
Windows, ll[io]fstream very closely resembles std::[io]fstream.
Since we no longer depend on that extension, we can remove its #include.
This should (!) remove the last obstacle to building with libc++ on the Mac.
2015-04-15 16:49:58 -04:00
Nat Goodspeed e9be710daf Strip down the Windows ll[io]fstream implementations to constructors
and open() methods. The only remaining value added by ll[io]fstream over
std::[io]stream is proper handling of non-ASCII pathnames, which can be done
by deriving from std::[io]stream, converting pathname strings and passing them
to the corresponding base-class methods.
This is only necessary on Windows. On Posix, ll[io]fstream are already
typedefs for std::[io]fstream.
This change removes a significant volume of cruft from llfile.{h,cpp}.
2015-04-15 13:26:32 -04:00
Oz Linden 5c6cf3e7fb restore the ll[io]fstream because we need them as wrappers on Windows for wide char paths; on other platforms they are now just typedefs to the std classes 2015-04-10 11:02:37 -04:00
Oz Linden 8b42c7898e replace llifstream and llofstream with std::ifstream and std::ofstream respectively 2015-04-07 17:59:28 -04:00
Oz Linden 3a57b18896 convert llifstream and llofstream to std::ifstream and std::ofstream respectively 2015-04-07 17:28:05 -04:00
Nat Goodspeed ae6440eecc MAINT-4744: Eliminate viewer dependency on (old) GNU libstdc++.
To be more accurate, this changeset doesn't actually eliminate the dependency:
it eliminates the use cases for the llifstream / llofstream feature that
requires it.
Currently you can construct an llifstream or llofstream from an open LLFILE*
file handle (or, except on Windows, an int file descriptor). But rather than
containing a streambuf implementation based on FILE*, llfile.h relies on the
fact that the Windows std::filebuf happens to support that as a nonstandard
extension; also on a nonstandard GNU extension __gnu_cxx::stdio_filebuf<char>.
To move from GNU libstdc++ to clang's libc++ (the direction on Mac), we could
code a streambuf that supports FILE*. But before doing that, it's worth asking
whether anyone actually uses this questionable feature.
In fact there were only two methods: LLWearable::exportFile() and importFile()
-- and only one call to either, in LLViewerWearable::saveNewAsset(). The code
in saveNewAsset() opened the LLFILE* immediately before calling exportFile(),
meaning we could reasonably push the open operation down into exportFile().
That logic was complex anyway due to the need for the caller to close the
LLFILE* regardless of the success of the exportFile().
Change LLWearable::exportFile() and importFile() to accept a std::string
filename rather than an open LLFILE*. Change LLViewerWearable::saveNewAsset()
to simply call exportFile(filename) rather than horsing around with an LLFILE*
handle. (This improves the code in another way too: it encapsulates the need
to open the relevant file in binary mode. Previously, each caller had to
remember to do that.)
To prevent inadvertent reintroduction of ll[io]fstream(LLFILE*) code, add
llstream_LLFILE preprocessor macro (default 0) to control access to the
relevant constructors. Also suppress rdbuf() override, the only method whose
signature references llstdio_filebuf.
2015-01-28 15:55:18 -05:00
callum_linden aca7976b87 Update to build on Xcode 6.0: turn BACK ON warnings as errors for overloaded virtuals [-Woverloaded-virtual] and fix up first (of many) files 2014-10-17 13:05:04 -07:00
Aura Linden d2bb4dae98 Fixes for crash reporter startup race condition, crash reporter CPU use, Secondlife.log filehandle, XP Crash. 2014-03-07 14:58:22 -08:00
Graham Madarasz 025c890958 Merge vwr-dev-mat 2013-05-01 08:11:15 -07:00
Graham Madarasz 806d09b114 Merge 3.5.1 into Materials 2013-04-30 19:50:05 -07:00
Oz Linden ddd5659f81 merge changes for DRTVWR-294 2013-04-19 10:11:29 -04:00
Graham Madarasz bf6182daa8 Update Mac and Windows breakpad builds to latest 2013-03-29 07:50:08 -07:00
developer@Developer-PC ecf72da021 More windows build fixes 2012-09-21 22:21:42 -07:00
Don Kjer e9e459c89c Restoring llrenderheadless changes so we can fix them 2012-09-20 17:13:16 +00:00
Don Kjer 0fc7c2aac1 Fix for windows compile issue 2012-09-20 06:32:43 +00:00
Don Kjer 7153d1db11 Partial rewrite of llifstream and llofstream (Windows implementation pending). Moved more functionality from llviewerwearable to llwearable 2012-09-20 04:29:17 +00:00
Dave SIMmONs 0dce88bc92 ER-330 : Improve ObjectUpdateCached message packing. Added some viewer metrics, will disable later. 2010-11-19 16:49:24 -08:00
Oz Linden 06b0d72efa Change license from GPL to LGPL (version 2.1) 2010-08-13 07:24:57 -04:00
Brad Kittenbrink 01d390825a DEV-27646 dll linkage for login module.
Ok, finally got this to a point where it doesn't break the build and I can check
in. llcommon can be built as a shared library (disabled but can be enabled with
cmake cache var LLCOMMON_LINK_SHARED.

reviewed by Mani on tuesday (I still need to get his suggested changes
re-reviewed)
2009-05-22 23:27:16 +00:00
Aaron Brashears e3cf284388 Result of svn merge -r107256:107258 svn+ssh://svn/svn/user/phoenix/license_2009_merge into trunk. QAR-1165 2009-01-08 00:05:06 +00:00
Steven Bennetts 25c10ed028 QAR-628 merge string-cleanup-5 -r 90476:90508 -> release
dataserver-is-deprecated
2008-06-26 00:39:00 +00:00
Bryan O'Sullivan 9db949eec3 svn merge -r88066:88786 svn+ssh://svn.lindenlab.com/svn/linden/branches/cmake-9-merge
dataserver-is-deprecated
for-fucks-sake-whats-with-these-commit-markers
2008-06-02 21:14:31 +00:00
Steven Bennetts 63e7894148 QAR-570 maint-render-4 merge
merge -r 87067:87077 svn+ssh://svn.lindenlab.com/svn/linden/branches/maint-render/maint-render-4-merge -> release. dataserver-is-deprecated.
2008-05-08 18:41:20 +00:00
Steven Bennetts 6fcf38217e merge release@82858 maint-render-2-merge@83010 -> release
QAR-389
2008-03-25 22:50:26 +00:00
Josh Bell 8bd6a0b321 svn merge -r 79445:79449 svn+ssh://svn.lindenlab.com/svn/linden/qa/maintenance-5-merge-79386
QAR-242 merge of maintenance-5 (QAR-203)
* DEV-6548 Copy To Inventory fail to execute without any output feedback when Notecard has changes but not saved
* DEV-7600 Deleting someone else's object in god mode crashes sim
* DEV-5329 LLSD parsers should determine and set maximum parse sizes
* DEV-7473 Resolve instant message crash report
* DEV-2904 Presence Issues not (apparently) caused by scripted attachments
* DEV-7083 Investigate Null Folder IDs Bug that caused 470K inventory items with Null Folder IDS on the Grid
* DEV-2865 Textures/Snapshots in a notecard are opened again when you click copy to inventory.
* DEV-6612 VWR-3290: Linux scons build script doesn't work with distcc
* DEV-8002 c++ llsd notation parser accepts malformed data
* DEV-8001 c++ xml parse returns wrong number of elements parsed
* DEV-8089 Double delete in statc structured data parse functions
* DEV-5326 Any viewer can request presence information for any agent
* DEV-2378 python service builder does not sort query string
* DEV-7872 Block teleport off teen grid sub-estates like Schome Park / Open University
* DEV-4465 Add a "logfile" command line option to the sim to create log files
2008-02-07 17:15:18 +00:00
Aaron Brashears 5595a99623 Result of svn merge -r71162:71205 svn+ssh://svn/svn/linden/branches/new-license into release. only changes files which are not deployed or the comments section of code. 2007-10-04 23:19:43 +00:00
Aaron Brashears 4942a7b779 Result of svn merge -r70873:71086 svn+ssh://svn/svn/linden/branches/enable-exceptions into release. 2007-10-04 16:31:48 +00:00
Steven Bennetts 4dabd9c047 merge release@58699 beta-1-14-0@58707 -> release 2007-03-02 21:25:50 +00:00
Mark Lentczner d0d4670f49 merge in of error-refactor-3
concludes (fixes) SL-31187
pair programmed and reviewed by markl and karen
2007-02-06 00:57:33 +00:00
Aaron Brashears 305c74d516 Result of svn merge -r57264:57370 svn+ssh://svn/svn/linden/branches/adroit.r40-68 into release. 2007-02-02 17:28:58 +00:00
James Cook 420b91db29 Print done when done. 2007-01-02 08:33:20 +00:00