From: Simone Piccardi Date: Tue, 6 Aug 2019 15:36:32 +0000 (+0200) Subject: Correzioni per consentire la compilazione e l'uso del Makefile con un X-Git-Url: https://gapil.gnulinux.it/gitweb/?a=commitdiff_plain;h=5b278ebdd05a632c61fef8bdb42550cf864694e9;p=gapil.git Correzioni per consentire la compilazione e l'uso del Makefile con un gcc piĆ¹recente (e versioni recenti delle librerie con diverse posizioni dei file di include). --- diff --git a/sources/Flock.c b/sources/Flock.c index 82790ec..90e7661 100644 --- a/sources/Flock.c +++ b/sources/Flock.c @@ -36,7 +36,7 @@ #include /* standard I/O library */ #include /* C strings library */ #include /* file control functions */ - +#include /* user defined header */ #include "macros.h" /* some useful macros */ diff --git a/sources/FortuneClient.c b/sources/FortuneClient.c index 5d8ba0a..99af385 100644 --- a/sources/FortuneClient.c +++ b/sources/FortuneClient.c @@ -38,6 +38,7 @@ #include /* file control functions */ #include /* C strings library */ #include /* system limits constants, types and functions */ +#include #include "macros.h" diff --git a/sources/Gapil.h b/sources/Gapil.h index dc421f4..70c796d 100644 --- a/sources/Gapil.h +++ b/sources/Gapil.h @@ -56,36 +56,36 @@ union semun { * Mutex handling Functions */ /* Function MutexCreate: create a mutex. See Mutex.c */ -inline int MutexCreate(key_t ipc_key); +int MutexCreate(key_t ipc_key); /* Function MutexFind: get the mutex ID given fomr IPC key. See Mutex.c */ -inline int MutexFind(key_t ipc_key); +int MutexFind(key_t ipc_key); /* Function MutexRead: read the current value of the mutex. See Mutex.c */ -inline int MutexRead(int sem_id); +int MutexRead(int sem_id); /* Function MutexLock: to lock a mutex/semaphore. See Mutex.c */ -inline int MutexLock(int sem_id); +int MutexLock(int sem_id); /* Function MutexUnlock: to unlock a mutex/semaphore. See Mutex.c */ -inline int MutexUnlock(int sem_id); +int MutexUnlock(int sem_id); /* Function MutexRemove: remove the mutex/semphore. See Mutex.c */ -inline int MutexRemove(int sem_id); +int MutexRemove(int sem_id); /* Function CreateMutex: create a mutex (using file locking). See Mutex.c */ -inline int CreateMutex(const char *path_name); +int CreateMutex(const char *path_name); /* Function UnlockMutex: find a mutex (using file locking). See Mutex.c */ -inline int FindMutex(const char *path_name); +int FindMutex(const char *path_name); /* Function LockMutex: acquire a mutex (using file locking). See Mutex.c */ -inline int LockMutex(int fd); +int LockMutex(int fd); /* Function UnlockMutex: release a mutex (using file locking). See Mutex.c */ -inline int UnlockMutex(int fd); +int UnlockMutex(int fd); /* Function ReadMutex: read a mutex (using file locking). See Mutex.c */ -inline int ReadMutex(int fd); +int ReadMutex(int fd); /* Function RemoveMutex: remove a mutex (using file locking). See Mutex.c */ -inline int RemoveMutex(const char *path_name); +int RemoveMutex(const char *path_name); /* * Lock files function: to create and destroy lock files */ /* Function LockFile: create a lock file. See FileLock.c */ -inline int LockFile(const char* path_name); +int LockFile(const char* path_name); /* Function UnlockFile: remove a lock file. See FileLock.c */ -inline int UnlockFile(const char* path_name); +int UnlockFile(const char* path_name); /* * Signal Handling Functions */ diff --git a/sources/Makefile b/sources/Makefile index 97f4dfe..ea5155b 100644 --- a/sources/Makefile +++ b/sources/Makefile @@ -23,13 +23,13 @@ $(OBJ): Gapil.h all: $(FINAL) $(LIB) dirmonitor: DirMonitor.c - $(CC) $(CFLAGJ) $^ -o $@ + $(CC) $^ -o $@ $(CFLAGJ) -lrt readmon: ReadMonitor.c - $(CC) $(CFLAGJ) $^ -o $@ + $(CC) $^ -o $@ $(CFLAGJ) -lrt myls: myls.c - $(CC) $(CFLAGJ) $^ -o $@ + $(CC) $^ -o $@ $(CFLAGJ) -lrt mylschroot: mylschroot.c $(CC) --static $^ dir_scan.o -o $@ @@ -38,22 +38,22 @@ flock: Flock.c $(CC) $^ -o $@ mqfortune: MQFortuneClient.c FortuneParse.c - $(CC) $(CFLAGJ) $^ -o $@ + $(CC) $^ -o $@ $(CFLAGJ) mqfortuned: MQFortuneServer.c FortuneParse.c - $(CC) $(CFLAGJ) $^ -o $@ + $(CC) $^ -o $@ $(CFLAGJ) -lrt fortune: FortuneClient.c - $(CC) $(CFLAGJ) $^ -o $@ + $(CC) $^ -o $@ fortuned: FortuneServer.c FortuneParse.c - $(CC) $(CFLAGJ) $^ -o $@ + $(CC) $^ -o $@ $(CFLAGJ) -lrt message_setter: message_setter.c - $(CC) $(CFLAGJ) $^ -o $@ + $(CC) $^ -o $@ $(CFLAGJ) -lrt message_getter: message_getter.c - $(CC) $(CFLAGJ) $^ -o $@ + $(CC) $^ -o $@ $(CFLAGJ) -lrt -lpthread barcode: BarCode.c $(CC) $^ -o $@ @@ -62,60 +62,60 @@ barcodepage: BarCodePage.c $(CC) $^ -o $@ getparam: getparam.c - $(CC) $(CFLAGJ) $^ -o $@ + $(CC) $^ -o $@ testfopen: test_fopen.c - $(CC) $(CFLAGJ) $^ -o $@ + $(CC) $^ -o $@ testren: TestRen.c - $(CC) $(CFLAGJ) $^ -o $@ + $(CC) $^ -o $@ forktest: fork_test.c - $(CC) $(CFLAGJ) $^ -o $@ + $(CC) $^ -o $@ $(CFLAGJ) -lrt errcode: ErrCode.c - $(CC) $(CFLAGJ) $^ -o $@ + $(CC) $^ -o $@ uecho: UDP_echo.c - $(CC) $(CFLAGJ) $(CFLAGS) $^ -o $@ + $(CC) $(CFLAGS) $^ -o $@ $(CFLAGJ) techo: TCP_echo.c - $(CC) $(CFLAGJ) $(CFLAGS) $^ -o $@ + $(CC) $(CFLAGS) $^ -o $@ $(CFLAGJ) -lrt echod: TCP_echod.c - $(CC) $(CFLAGJ) $(CFLAGS) $^ -o $@ + $(CC) $(CFLAGS) $^ -o $@ $(CFLAGJ) -lrt sechod: select_echod.c - $(CC) $(CFLAGJ) $(CFLAGS) $^ -o $@ + $(CC) $(CFLAGS) $^ -o $@ $(CFLAGJ) -lrt pechod: poll_echod.c - $(CC) $(CFLAGJ) $(CFLAGS) $^ -o $@ + $(CC) $(CFLAGS) $^ -o $@ $(CFLAGJ) -lrt daytimed: UDP_daytimed.c # TCP_cunc_daytimed.c - $(CC) $(CFLAGJ) $^ -o $@ + $(CC) $^ -o $@ iterdaytimed: TCP_iter_daytimed.c - $(CC) $(CFLAGJ) $^ -o $@ + $(CC) $^ -o $@ daytime: UDP_daytime.c # TCP_daytime.c - $(CC) $(CFLAGJ) $(CFLAGS) $^ -o $@ + $(CC) $(CFLAGS) $^ -o $@ ipctestid: IPCTestId.c - $(CC) $^ -o $@ + $(CC) $^ -o $@ writeshm: WriteShm.c - $(CC) $(CFLAGJ) $^ -o $@ + $(CC) $^ -o $@ $(CFLAGJ) -lrt mygetaddr: mygetaddr.c - $(CC) $(CFLAGJ) $^ -o $@ + $(CC) $^ -o $@ endtest: endtest.c -readshm: ReadShm.c - $(CC) $(CFLAGJ) $^ -o $@ +#readshm: ReadShm.c +# $(CC) $^ -o $@ wwwd: wwwd.c - $(CC) $(CFLAGJ) $(CFLAGS) $^ -o $@ + $(CC) $(CFLAGS) $^ -o $@ $(CFLAGJ) -lrt acctctrl: AcctCtrl.c $(CC) $(CFLAGS) $^ -o $@ diff --git a/sources/getparam.c b/sources/getparam.c index f44f51d..b5207b7 100644 --- a/sources/getparam.c +++ b/sources/getparam.c @@ -172,8 +172,8 @@ int main(int argc, char *argv[]) usage(); } for (i=0; i<=4; i++) { - printf("Response for %s is %ld, values is %ld\n", names[i], - sysconf(argument[i]), values[i]); + printf("Response for %s is %ld, values is %ld\n",sc_names[i], + sysconf(sc_argument[i]), values[i]); } return 0; }