~vcs-imports/busybox/trunk

« back to all changes in this revision

Viewing changes to sysklogd/logread.c

  • Committer: Denys Vlasenko
  • Author(s): Christian Franke
  • Date: 2023-11-13 10:32:35 UTC
  • Revision ID: git-v1:a63b60bdd6fa26b867c80d44074118babbae7ffd
Cygwin: regenerate defconfig

Signed-off-by: Christian Franke <christian.franke@t-online.de>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
10
10
 */
11
11
//config:config LOGREAD
12
 
//config:       bool "logread (4.8 kb)"
 
12
//config:       bool "logread (5 kb)"
13
13
//config:       default y
14
14
//WRONG: it should be compilable without SYSLOG=y:
15
15
//WRONG:        depends on FEATURE_IPC_SYSLOG
180
180
                        if (cur == shbuf_tail) {
181
181
                                sem_up(log_semid);
182
182
                                fflush_all();
183
 
                                sleep(1); /* TODO: replace me with a sleep_on */
 
183
                                sleep1(); /* TODO: replace me with a sleep_on */
184
184
                                continue;
185
185
                        }
186
186
                }
205
205
                cur = shbuf_tail;
206
206
#else
207
207
                while (cur != shbuf_tail) {
208
 
                        fputs(shbuf_data + cur, stdout);
 
208
                        fputs_stdout(shbuf_data + cur);
209
209
                        cur += strlen(shbuf_data + cur) + 1;
210
210
                        if (cur >= shbuf_size)
211
211
                                cur = 0;
217
217
 
218
218
#if ENABLE_FEATURE_LOGREAD_REDUCED_LOCKING
219
219
                for (i = 0; i < len_total; i += strlen(copy + i) + 1) {
220
 
                        fputs(copy + i, stdout);
 
220
                        fputs_stdout(copy + i);
221
221
                }
222
222
                free(copy);
223
223
#endif
226
226
 
227
227
        /* shmdt(shbuf); - on Linux, shmdt is not mandatory on exit */
228
228
 
229
 
        fflush_stdout_and_exit(EXIT_SUCCESS);
 
229
        fflush_stdout_and_exit_SUCCESS();
230
230
}