~lnykryn/upstart/global-configuration

« back to all changes in this revision

Viewing changes to init/log.c

  • Committer: James Hunt
  • Date: 2011-12-15 16:22:57 UTC
  • Revision ID: james.hunt@ubuntu.com-20111215162257-xa8bi9nba6965jco
* init/log.c:
  - log_file_open(): Comments.
  - log_file_write(): Added missing cast on
    nih_io_buffer_shrink() call.

Show diffs side-by-side

added added

removed removed

Lines of Context:
333
333
         * unlinked file, but it *is* a problem for
334
334
         * users who expect to see some data. Therefore,
335
335
         * close the file and attempt to rewrite it.
 
336
         *
 
337
         * This behaviour also allows tools such as logrotate(8)
 
338
         * to operate without disrupting the logger.
336
339
         */
337
340
        if (log->fd > -1 && ! statbuf.st_nlink) {
338
341
                close (log->fd);
454
457
                        goto error;
455
458
                }
456
459
 
457
 
                nih_io_buffer_shrink (log->unflushed, wlen);
 
460
                nih_io_buffer_shrink (log->unflushed, (size_t)wlen);
458
461
        }
459
462
 
460
463
        /* Only managed a partial write for the unflushed data,