diff options
Diffstat (limited to 'indra/newview/llappviewerlinux.cpp')
-rw-r--r-- | indra/newview/llappviewerlinux.cpp | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/indra/newview/llappviewerlinux.cpp b/indra/newview/llappviewerlinux.cpp index ed291c16a8..d34bcb4a68 100644 --- a/indra/newview/llappviewerlinux.cpp +++ b/indra/newview/llappviewerlinux.cpp @@ -188,7 +188,7 @@ static inline BOOL do_basic_glibc_backtrace() for (i = 0; i < size; i++) { // the format of the StraceFile is very specific, to allow (kludgy) machine-parsing - fprintf(StraceFile, "%-3d ", i); + fprintf(StraceFile, "%-3lu ", (unsigned long)i); fprintf(StraceFile, "%-32s\t", "unknown"); fprintf(StraceFile, "%p ", stackarray[i]); fprintf(StraceFile, "%s\n", strings[i]); @@ -263,7 +263,7 @@ static inline BOOL do_elfio_glibc_backtrace() for (btpos = 0; btpos < btsize; ++btpos) { // the format of the StraceFile is very specific, to allow (kludgy) machine-parsing - fprintf(StraceFile, "%-3d ", btpos); + fprintf(StraceFile, "%-3ld ", (long)btpos); int symidx; for (symidx = 0; symidx < nSymNo; ++symidx) { @@ -354,7 +354,7 @@ bool LLAppViewerLinux::init() bool LLAppViewerLinux::restoreErrorTrap() { - // *NOTE:Mani there is a case for implementing this or the mac. + // *NOTE:Mani there is a case for implementing this on the mac. // Linux doesn't need it to my knowledge. return true; } @@ -727,8 +727,26 @@ std::string LLAppViewerLinux::generateSerialNumber() { char serial_md5[MD5HEX_STR_SIZE]; serial_md5[0] = 0; + std::string best; + std::string uuiddir("/dev/disk/by-uuid/"); - // TODO + // trawl /dev/disk/by-uuid looking for a good-looking UUID to grab + std::string this_name; + BOOL wrap = FALSE; + while (gDirUtilp->getNextFileInDir(uuiddir, "*", this_name, wrap)) + { + if (this_name.length() > best.length() || + (this_name.length() == best.length() && + this_name > best)) + { + // longest (and secondarily alphabetically last) so far + best = this_name; + } + } + + // we don't return the actual serial number, just a hash of it. + LLMD5 md5( reinterpret_cast<const unsigned char*>(best.c_str()) ); + md5.hex_digest(serial_md5); return serial_md5; } |