~ubuntu-branches/ubuntu/precise/corosync/precise-proposed

« back to all changes in this revision

Viewing changes to lcr/uis.c

  • Committer: Bazaar Package Importer
  • Author(s): Martin Loschwitz
  • Date: 2011-10-19 14:32:18 UTC
  • mfrom: (1.1.6 upstream) (5.1.16 sid)
  • Revision ID: james.westby@ubuntu.com-20111019143218-ew8phl0raqyog844
Tags: 1.4.2-1
* Changed my email address in debian/control
* Add corosync-blackbox to the corosync package
* Imported Upstream version 1.4.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
99
99
        res = bind (fd, (struct sockaddr *)&un_addr, AIS_SUN_LEN(&un_addr));
100
100
        if (res) {
101
101
                char error_str[100];
102
 
                strerror_r (errno, error_str, 100);
103
 
                printf ("Could not bind AF_UNIX: %s\n", error_str);
 
102
                const char *error_ptr;
 
103
#ifdef _GNU_SOURCE
 
104
/* The GNU version of strerror_r returns a (char*) that *must* be used */
 
105
                error_ptr = strerror_r(errno, error_str, sizeof(error_str));
 
106
#else
 
107
/* The XSI-compliant strerror_r() return 0 or -1 (in case the buffer is full) */
 
108
                strerror_r(errno, error_str, sizeof(error_str));
 
109
                error_ptr = error_str;
 
110
#endif
 
111
                printf ("Could not bind AF_UNIX: %s\n", error_ptr);
104
112
        }
105
113
        listen (fd, SERVER_BACKLOG);
106
114
        *server_fd = fd;