diff options
author | Eric Andersen <andersen@codepoet.org> | 2004-03-15 11:29:22 +0300 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2004-03-15 11:29:22 +0300 |
commit | c7bda1ce659294d6e22c06e087f6f265983c7578 (patch) | |
tree | 4c6d2217f4d8306c59cf1096f8664e1cfd167213 /sysklogd/logread.c | |
parent | 8854004b41065b3d081af7f3df13a100b0c8bfbe (diff) |
Remove trailing whitespace. Update copyright to include 2004.
Diffstat (limited to 'sysklogd/logread.c')
-rw-r--r-- | sysklogd/logread.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/sysklogd/logread.c b/sysklogd/logread.c index 207e78b57..70d1db631 100644 --- a/sysklogd/logread.c +++ b/sysklogd/logread.c @@ -62,13 +62,13 @@ static void interrupted(int sig); */ static inline void sem_up(int semid) { - if ( semop(semid, SMrup, 1) == -1 ) + if ( semop(semid, SMrup, 1) == -1 ) error_exit("semop[SMrup]"); } /* * sem_down - down()'s a semaphore - */ + */ static inline void sem_down(int semid) { if ( semop(semid, SMrdn, 2) == -1 ) @@ -79,7 +79,7 @@ extern int logread_main(int argc, char **argv) { int i; int follow=0; - + if (argc == 2 && strcmp(argv[1],"-f")==0) { follow = 1; } else { @@ -87,16 +87,16 @@ extern int logread_main(int argc, char **argv) if (argc > 1) bb_show_usage(); } - + // handle intrrupt signal if (setjmp(jmp_env)) goto output_end; - + // attempt to redefine ^C signal signal(SIGINT, interrupted); - + if ( (log_shmid = shmget(KEY_ID, 0, 0)) == -1) error_exit("Can't find circular buffer"); - + // Attach shared memory to our char* if ( (buf = shmat(log_shmid, NULL, SHM_RDONLY)) == NULL) error_exit("Can't get access to circular buffer from syslogd"); @@ -113,7 +113,7 @@ extern int logread_main(int argc, char **argv) int log_len,j; #endif - sem_down(log_semid); + sem_down(log_semid); //printf("head: %i tail: %i size: %i\n",buf->head,buf->tail,buf->size); if (buf->head == buf->tail || i==buf->tail) { @@ -125,8 +125,8 @@ extern int logread_main(int argc, char **argv) printf("<empty syslog>\n"); } } - - // Read Memory + + // Read Memory #ifdef CONFIG_FEATURE_LOGREAD_REDUCED_LOCKING log_len = buf->tail - i; if (log_len < 0) @@ -165,10 +165,10 @@ extern int logread_main(int argc, char **argv) } while (follow); output_end: - if (log_shmid != -1) + if (log_shmid != -1) shmdt(buf); - - return EXIT_SUCCESS; + + return EXIT_SUCCESS; } static void interrupted(int sig){ @@ -179,7 +179,7 @@ static void interrupted(int sig){ static void error_exit(const char *str){ perror(str); //release all acquired resources - if (log_shmid != -1) + if (log_shmid != -1) shmdt(buf); exit(1); |