~ubuntu-branches/ubuntu/lucid/rsyslog/lucid-updates

« back to all changes in this revision

Viewing changes to runtime/debug.c

  • Committer: Bazaar Package Importer
  • Author(s): Michael Biebl
  • Date: 2009-06-23 12:12:43 UTC
  • mfrom: (1.1.11 upstream) (3.2.8 sid)
  • Revision ID: james.westby@ubuntu.com-20090623121243-d2fejarzidywnn17
Tags: 4.2.0-1
* New upstream release of the now stable v4 branch.
  - Fix warnings when /etc/rsyslog.d/ is empty. Closes: #530228
* debian/patches/imudp_multiple_udp_sockets.patch
  - Removed, merged upstream.
* debian/rsyslog.default
  - Set default compat mode to '4'.
* debian/rsyslog.logcheck.ignore.server
  - Update logcheck rules files to also ignore rsyslogd and imklog stop
    messages.
* debian/control
  - Bump Standards-Version to 3.8.2. No further changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <sys/syscall.h>
1
2
/* debug.c
2
3
 *
3
4
 * This file proides debug and run time error analysis support. Some of the
886
887
                        if(stddbg != -1) write(stddbg, pszWriteBuf, lenWriteBuf);
887
888
                        if(altdbg != -1) write(altdbg, pszWriteBuf, lenWriteBuf);
888
889
                }
 
890
 
889
891
                lenWriteBuf = snprintf(pszWriteBuf, sizeof(pszWriteBuf), "%s: ", pszThrdName);
 
892
                // use for testing: lenWriteBuf = snprintf(pszWriteBuf, sizeof(pszWriteBuf), "{%ld}%s: ", (long) syscall(SYS_gettid), pszThrdName);
890
893
                if(stddbg != -1) write(stddbg, pszWriteBuf, lenWriteBuf);
891
894
                if(altdbg != -1) write(altdbg, pszWriteBuf, lenWriteBuf);
892
895
                /* print object name header if we have an object */
1340
1343
 
1341
1344
        if(pszAltDbgFileName != NULL) {
1342
1345
                /* we have a secondary file, so let's open it) */
1343
 
                if((altdbg = open(pszAltDbgFileName, O_WRONLY|O_CREAT|O_TRUNC|O_NOCTTY, S_IRUSR|S_IWUSR)) == -1) {
 
1346
                if((altdbg = open(pszAltDbgFileName, O_WRONLY|O_CREAT|O_TRUNC|O_NOCTTY|O_CLOEXEC, S_IRUSR|S_IWUSR)) == -1) {
1344
1347
                        fprintf(stderr, "alternate debug file could not be opened, ignoring. Error: %s\n", strerror(errno));
1345
1348
                }
1346
1349
        }