Project

General

Profile

0001-fix-oidentconfigger-build-under-windows.patch

cpuesser, 02/20/2012 01:15 PM

View differences:

src/core/oidentdconfiggenerator.cpp
17 17
 *   Free Software Foundation, Inc.,                                       *
18 18
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
19 19
 ***************************************************************************/
20

  
21 20
#include "oidentdconfiggenerator.h"
22 21

  
23 22
OidentdConfigGenerator::OidentdConfigGenerator(QObject *parent) :
......
103 102
}
104 103

  
105 104
bool OidentdConfigGenerator::writeConfig() {
105

  
106
#ifndef Q_OS_WIN32
106 107
  mode_t prev_umask = umask(S_IXUSR | S_IWGRP | S_IXGRP | S_IWOTH | S_IXOTH); // == 0133, rw-r--r--
107 108
  bool not_open = (!_configFile->isOpen() && !_configFile->open(QIODevice::ReadWrite | QIODevice::Text));
108 109
  umask(prev_umask);
110
#else
111
    int prev_umask    = _umask(_S_IREAD | _S_IWRITE);
112
    bool not_open = (!_configFile->isOpen() && !_configFile->open(QIODevice::ReadWrite | QIODevice::Text));
113
    _umask(prev_umask);
114
#endif /* Q_OS_WIN32 */
109 115

  
110 116
  if (not_open)
111 117
    return false;
src/core/oidentdconfiggenerator.h
29 29
#include <QMutex>
30 30
#include <QByteArray>
31 31

  
32
#ifndef Q_OS_WIN32
33
#  include <sys/types.h>
34
#  include <sys/stat.h>
32
//#ifndef Q_OS_WIN32
33
#include <sys/types.h>
34
#include <sys/stat.h>
35
#ifdef Q_OS_WIN32
36
  #include <io.h>
35 37
#endif /* Q_OS_WIN32 */
36 38

  
37 39
#include "quassel.h"
38
-