opendx-4.4.4-open.patch 1.6 KB

1234567891011121314151617181920212223242526272829303132333435
  1. diff -up dx-4.4.4/src/exec/libdx/fileio.c.open dx-4.4.4/src/exec/libdx/fileio.c
  2. --- dx-4.4.4/src/exec/libdx/fileio.c.open 2006-01-05 23:55:47.000000000 +0100
  3. +++ dx-4.4.4/src/exec/libdx/fileio.c 2008-09-24 19:16:30.000000000 +0200
  4. @@ -263,7 +263,7 @@ Error _dxffile_open(char *name, int rw)
  5. case 2:/* read/write */
  6. fd = open(name, O_RDWR);
  7. if (fd < 0) {
  8. - fd = open(name, O_WRONLY | O_CREAT);
  9. + fd = open(name, O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR);
  10. if (fd < 0) {
  11. DXSetError(ERROR_DATA_INVALID,
  12. "can't open/create file '%s'", name);
  13. diff -up dx-4.4.4/src/exec/libdx/plock.c.open dx-4.4.4/src/exec/libdx/plock.c
  14. --- dx-4.4.4/src/exec/libdx/plock.c.open 2002-07-17 06:48:18.000000000 +0200
  15. +++ dx-4.4.4/src/exec/libdx/plock.c 2008-09-24 19:16:30.000000000 +0200
  16. @@ -37,7 +37,8 @@ struct seminfo *__buf; /* buffer fo
  17. #define SEM_FLAGS (IPC_CREAT | S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH)
  18. #define SHM_FLAGS (IPC_CREAT | S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH)
  19. -#define OPEN_FLAGS (O_CREAT | S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH)
  20. +#define OPEN_FLAGS (O_CREAT)
  21. +#define OPEN_MODE (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH)
  22. #define IS_MINE(a) (locks->_owner[a] == getpid())
  23. #define SET_OWNER(a) (locks->_owner[a] = getpid())
  24. #define CLEAR_OWNER(a) (locks->_owner[a] = 0)
  25. @@ -268,7 +269,7 @@ PLockInit()
  26. if (stat(LOCKFILE, &statbuf))
  27. {
  28. - int fd = open(LOCKFILE, OPEN_FLAGS);
  29. + int fd = open(LOCKFILE, OPEN_FLAGS, OPEN_MODE);
  30. if (fd < 0)
  31. {
  32. fprintf(stderr, "initLocks: error accessing locks shared block: open\n");