Move locking specific functions into their own source file
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Author......: Jens Steube <jens.steube@gmail.com>
|
||||
* License.....: MIT
|
||||
*/
|
||||
|
||||
#ifndef _LOCKING_H
|
||||
#define _LOCKING_H
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#ifdef F_SETLKW
|
||||
|
||||
void lock_file (FILE *fp);
|
||||
void unlock_file (FILE *fp);
|
||||
|
||||
#else
|
||||
|
||||
#define lock_file(dummy) {}
|
||||
#define unlock_file(dummy) {}
|
||||
|
||||
#endif
|
||||
|
||||
#endif // _LOCKING_H
|
||||
+1
-7
@@ -25,6 +25,7 @@
|
||||
#include <dlfcn.h>
|
||||
#include <pwd.h>
|
||||
#include <limits.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/sysctl.h>
|
||||
#endif // _POSIX
|
||||
@@ -187,13 +188,6 @@ char *stroptitype (const uint opti_type);
|
||||
char *strstatus (const uint threads_status);
|
||||
void status ();
|
||||
|
||||
#ifdef F_SETLKW
|
||||
void lock_file (FILE *fp);
|
||||
void unlock_file (FILE *fp);
|
||||
#else
|
||||
#define lock_file(dummy) {}
|
||||
#define unlock_file(dummy) {}
|
||||
#endif
|
||||
|
||||
#ifdef _WIN
|
||||
void fsync (int fd);
|
||||
|
||||
Reference in New Issue
Block a user