diff options
| author | Jeffrey Armstrong <jeffrey.armstrong@approximatrix.com> | 2014-03-02 13:53:33 -0500 |
|---|---|---|
| committer | Jeffrey Armstrong <jeffrey.armstrong@approximatrix.com> | 2014-03-02 13:53:33 -0500 |
| commit | 9155a365e1e0a7e9fec47447f86af09117b30edb (patch) | |
| tree | 6c54cfee6f4784aa777cef186dbca9aa1f856efd /db.c | |
| parent | ffe739eeb12d1bf9dadb2144e95fef79820c6844 (diff) | |
| download | prism-9155a365e1e0a7e9fec47447f86af09117b30edb.tar.gz prism-9155a365e1e0a7e9fec47447f86af09117b30edb.zip | |
Added support for building with GNU C (Linux, etc.). Fixed minor bugs in diff routine.
Diffstat (limited to 'db.c')
| -rw-r--r-- | db.c | 16 |
1 files changed, 11 insertions, 5 deletions
@@ -5,11 +5,17 @@ #include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <sys\types.h>
-#include <sys\stat.h>
-#include <direct.h>
+#include <sys/types.h>
+#include <sys/stat.h>
#include <errno.h>
+
+#ifdef __GNUC__
+#define MKDIR(x) mkdir(x, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)
+#else
+#include <direct.h>
#include <io.h>
+#define MKDIR(x) mkdir(x)
+#endif
#include "prism.h"
#include "db.h"
@@ -47,7 +53,7 @@ int initdb() FILE *fpdb;
FILE *fpmsg;
- if(mkdir(PDB_DIR) != 0) {
+ if(MKDIR(PDB_DIR) != 0) {
if(errno == EEXIST)
return PRET_EXISTS;
else if(errno == EACCES)
@@ -211,7 +217,7 @@ int res; #if defined(MSDOS) || defined(WIN32)
res = strcmpi(filename, reader);
#else
- res = strcmpi(filename, reader);
+ res = strcmp(filename, reader);
#endif
if(res == 0) {
info->id = strtol(line,&reader,16);
|
