critmem.c (leafnode-1.11.12.tar.bz2) | : | critmem.c (leafnode-1.12.0.tar.xz) | ||
---|---|---|---|---|
skipping to change at line 25 | skipping to change at line 25 | |||
* WITHOUT ANY WARRANTY; without even the implied warranty of | * WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
* Lesser General Public License for more details. | * Lesser General Public License for more details. | |||
* | * | |||
* You should have received a copy of the GNU Lesser General Public | * You should have received a copy of the GNU Lesser General Public | |||
* License along with this library; if not, write to the Free Software | * License along with this library; if not, write to the Free Software | |||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 | |||
* USA | * USA | |||
*/ | */ | |||
#ifndef _DEFAULT_SOURCE | ||||
#define _DEFAULT_SOURCE | ||||
#endif | ||||
#ifndef _GNU_SOURCE | ||||
#define _GNU_SOURCE | ||||
#endif | ||||
#ifndef _BSD_SOURCE | ||||
#define _BSD_SOURCE | ||||
#endif | ||||
#include "critmem.h" | #include "critmem.h" | |||
#include <stdio.h> | ||||
#include <stdlib.h> | #include <stdlib.h> | |||
#include <syslog.h> | #include <syslog.h> | |||
#include <string.h> | #include <string.h> | |||
#include <stdio.h> | ||||
static char ebuf[1024]; /* error buffer */ | static char ebuf[1024]; /* error buffer */ | |||
static int log_syslog = 1; /* log to syslog? */ | static int log_syslog = 1; /* log to syslog? */ | |||
static void barf(const char *func, size_t size, const char *message) { | static void barf(const char *func, size_t size, const char *message) { | |||
snprintf(ebuf, sizeof(ebuf), "%s(%ld) failed: %s", func, (long)size, message ); | snprintf(ebuf, sizeof(ebuf), "%s(%ld) failed: %s", func, (long)size, message ); | |||
if (log_syslog) | if (log_syslog) | |||
syslog(LOG_ERR, "%s", ebuf); | syslog(LOG_ERR, "%s", ebuf); | |||
fwrite(ebuf, strlen(ebuf), 1, stderr); | fwrite(ebuf, strlen(ebuf), 1, stderr); | |||
End of changes. 3 change blocks. | ||||
1 lines changed or deleted | 13 lines changed or added |