mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-12-20 15:41:23 +01:00
Master (#6)
* Fixed bug where wrong ID was used for local maintenance * Updated ChangeLog * Added ability to run macros from cart list with "Run Macro" button * Updated ChangeLog * Updated translations * 2018-10-18 Fred Gleason <fredg@paravelsystems.com> * Tweaked the position of buttons on the bottom row of the main screen of rdlibrary(1). * Changed the minimum size of the main screen of rdlibrary to 850x600. * 2018-10-18 Fred Gleason <fredg@paravelsystems.com> * Fixed a regression in rdmaint(8) that broke cut rehashing. * 2018-10-19 Fred Gleason <fredg@paravelsystems.com> * Added code in the %post and %preun rules in 'rivendell.spec.in' to enable and disable the 'rivendell' service. * 2018-10-19 Fred Gleason <fredg@paravelsystems.com> * Modified rdservice(8) to log errors to syslog. * Added an rdservice(8) man page. * Modified 'systemd/rivendell.service.in' to enable automatic start retries. * 2018-10-19 Fred Gleason <fredg@paravelsystems.com> * Fixed a typo that broke generation of the rmlsend(1) man page. * 2018-10-19 Fred Gleason <fredg@paravelsystems.com> * Removed 'build_win32.bat'. * Removed all conditional compilation based on 'WIN32'. * 2018-10-19 Fred Gleason <fredg@paravelsystems.com> * Removed check for Win32 installer from 'configure.ac'. * Removed win32 clauses from '.pro' files.
This commit is contained in:
committed by
GitHub
parent
48bbe8ee67
commit
4a3106c8dc
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// Securely create and then remove a temporary directory
|
||||
//
|
||||
// (C) Copyright 2017 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2017-2018 Fred Gleason <fredg@paravelsystems.com>
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License version 2 as
|
||||
@@ -20,9 +20,7 @@
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
#ifndef WIN32
|
||||
#include <unistd.h>
|
||||
#endif // WIN32
|
||||
|
||||
#include <qdatetime.h>
|
||||
#include <qstringlist.h>
|
||||
@@ -61,17 +59,6 @@ QString RDTempDirectory::path() const
|
||||
|
||||
bool RDTempDirectory::create(QString *err_msg)
|
||||
{
|
||||
#ifdef WIN32
|
||||
QDateTime now=QDateTime::currentDateTime();
|
||||
QString tempdir=RDTempDirectory::basePath()+"/"+temp_base_name+
|
||||
QString().sprintf("%u",now.toTime_t());
|
||||
temp_dir=new QDir(tempdir);
|
||||
if(!temp_dir->mkdir(tempdir)) {
|
||||
*err_msg="unable to create temp directory";
|
||||
delete temp_dir;
|
||||
return false;
|
||||
}
|
||||
#else
|
||||
char tempdir[PATH_MAX];
|
||||
|
||||
strncpy(tempdir,RDTempDirectory::basePath(),PATH_MAX);
|
||||
@@ -83,7 +70,6 @@ bool RDTempDirectory::create(QString *err_msg)
|
||||
return false;
|
||||
}
|
||||
temp_dir=new QDir(tempdir);
|
||||
#endif // WIN32
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -95,18 +81,8 @@ QString RDTempDirectory::basePath()
|
||||
if (!conf_temp_directory.isEmpty()) {
|
||||
return conf_temp_directory;
|
||||
}
|
||||
#ifdef WIN32
|
||||
if(getenv("TEMP")!=NULL) {
|
||||
return QString(getenv("TEMP"));
|
||||
}
|
||||
if(getenv("TMP")!=NULL) {
|
||||
return QString(getenv("TMP"));
|
||||
}
|
||||
return QString("C:\\");
|
||||
#else
|
||||
if(getenv("TMPDIR")!=NULL) {
|
||||
return QString(getenv("TMPDIR"));
|
||||
}
|
||||
return QString("/tmp");
|
||||
#endif // WIN32
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user