forked from osmocom/wireshark
Replace all strerror() with g_strerror().
Remove our local strerror implementation. Mark strerror as locale unsafe API. This fixes bug 5715. svn path=/trunk/; revision=37812daniel/osmux
parent
6c094f6775
commit
8443bbbf75
|
@ -25,7 +25,6 @@ check_include_file("stdarg.h" HAVE_STDARG_H)
|
|||
check_include_file("stddef.h" HAVE_STDDEF_H)
|
||||
check_include_file("stdint.h" HAVE_STDINT_H)
|
||||
check_include_file("stdlib.h" HAVE_STDLIB_H)
|
||||
check_include_file("strerror.h" NEED_STRERROR_H)
|
||||
check_include_file("strings.h" HAVE_STRINGS_H)
|
||||
check_include_file("string.h" HAVE_STRING_H)
|
||||
check_include_file("sys/ioctl.h" HAVE_SYS_IOCTL_H)
|
||||
|
|
|
@ -75,7 +75,7 @@ read_failure_alert_box(const char *filename, int err)
|
|||
{
|
||||
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
|
||||
"An error occurred while reading from the file \"%s\": %s.",
|
||||
filename, strerror(err));
|
||||
filename, g_strerror(err));
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -676,7 +676,7 @@ process_cap_file(wtap *wth, const char *filename)
|
|||
if (size == -1) {
|
||||
fprintf(stderr,
|
||||
"capinfos: Can't get size of \"%s\": %s.\n",
|
||||
filename, strerror(err));
|
||||
filename, g_strerror(err));
|
||||
g_free(cf_info.encap_counts);
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -127,7 +127,7 @@ get_interface_list(int *err, char **err_str)
|
|||
if (err_str != NULL) {
|
||||
*err_str = g_strdup_printf(
|
||||
"Can't get list of interfaces: error opening socket: %s",
|
||||
strerror(errno));
|
||||
g_strerror(errno));
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
@ -148,7 +148,7 @@ get_interface_list(int *err, char **err_str)
|
|||
if (err_str != NULL) {
|
||||
*err_str = g_strdup_printf(
|
||||
"Can't get list of interfaces: SIOCGIFCONF ioctl error: %s",
|
||||
strerror(errno));
|
||||
g_strerror(errno));
|
||||
}
|
||||
goto fail;
|
||||
}
|
||||
|
@ -206,7 +206,7 @@ get_interface_list(int *err, char **err_str)
|
|||
if (err_str != NULL) {
|
||||
*err_str = g_strdup_printf(
|
||||
"Can't get list of interfaces: SIOCGIFFLAGS error getting flags for interface %s: %s",
|
||||
ifr->ifr_name, strerror(errno));
|
||||
ifr->ifr_name, g_strerror(errno));
|
||||
}
|
||||
goto fail;
|
||||
}
|
||||
|
|
|
@ -595,7 +595,7 @@ sync_pipe_start(capture_options *capture_opts) {
|
|||
#else /* _WIN32 */
|
||||
if (pipe(sync_pipe) < 0) {
|
||||
/* Couldn't create the pipe between parent and child. */
|
||||
report_failure("Couldn't create sync pipe: %s", strerror(errno));
|
||||
report_failure("Couldn't create sync pipe: %s", g_strerror(errno));
|
||||
g_free( (gpointer) argv[0]);
|
||||
g_free(argv);
|
||||
return FALSE;
|
||||
|
@ -610,7 +610,7 @@ sync_pipe_start(capture_options *capture_opts) {
|
|||
ws_close(sync_pipe[PIPE_READ]);
|
||||
execv(argv[0], (gpointer)argv);
|
||||
g_snprintf(errmsg, sizeof errmsg, "Couldn't run %s in child process: %s",
|
||||
argv[0], strerror(errno));
|
||||
argv[0], g_strerror(errno));
|
||||
sync_pipe_errmsg_to_parent(2, errmsg, "");
|
||||
|
||||
/* Exit with "_exit()", so that we don't close the connection
|
||||
|
@ -644,7 +644,7 @@ sync_pipe_start(capture_options *capture_opts) {
|
|||
|
||||
if (capture_opts->fork_child == -1) {
|
||||
/* We couldn't even create the child process. */
|
||||
report_failure("Couldn't create child process: %s", strerror(errno));
|
||||
report_failure("Couldn't create child process: %s", g_strerror(errno));
|
||||
ws_close(sync_pipe_read_fd);
|
||||
#ifdef _WIN32
|
||||
ws_close(capture_opts->signal_pipe_write_fd);
|
||||
|
@ -795,7 +795,7 @@ sync_pipe_open_command(const char** argv, int *data_read_fd,
|
|||
/* Create a pipe for the child process to send us messages */
|
||||
if (pipe(sync_pipe) < 0) {
|
||||
/* Couldn't create the message pipe between parent and child. */
|
||||
*msg = g_strdup_printf("Couldn't create sync pipe: %s", strerror(errno));
|
||||
*msg = g_strdup_printf("Couldn't create sync pipe: %s", g_strerror(errno));
|
||||
g_free( (gpointer) argv[0]);
|
||||
g_free(argv);
|
||||
return -1;
|
||||
|
@ -804,7 +804,7 @@ sync_pipe_open_command(const char** argv, int *data_read_fd,
|
|||
/* Create a pipe for the child process to send us data */
|
||||
if (pipe(data_pipe) < 0) {
|
||||
/* Couldn't create the data pipe between parent and child. */
|
||||
*msg = g_strdup_printf("Couldn't create data pipe: %s", strerror(errno));
|
||||
*msg = g_strdup_printf("Couldn't create data pipe: %s", g_strerror(errno));
|
||||
ws_close(sync_pipe[PIPE_READ]);
|
||||
ws_close(sync_pipe[PIPE_WRITE]);
|
||||
g_free( (gpointer) argv[0]);
|
||||
|
@ -825,7 +825,7 @@ sync_pipe_open_command(const char** argv, int *data_read_fd,
|
|||
ws_close(sync_pipe[PIPE_WRITE]);
|
||||
execv(argv[0], (gpointer)argv);
|
||||
g_snprintf(errmsg, sizeof errmsg, "Couldn't run %s in child process: %s",
|
||||
argv[0], strerror(errno));
|
||||
argv[0], g_strerror(errno));
|
||||
sync_pipe_errmsg_to_parent(2, errmsg, "");
|
||||
|
||||
/* Exit with "_exit()", so that we don't close the connection
|
||||
|
@ -862,7 +862,7 @@ sync_pipe_open_command(const char** argv, int *data_read_fd,
|
|||
|
||||
if (*fork_child == -1) {
|
||||
/* We couldn't even create the child process. */
|
||||
*msg = g_strdup_printf("Couldn't create child process: %s", strerror(errno));
|
||||
*msg = g_strdup_printf("Couldn't create child process: %s", g_strerror(errno));
|
||||
ws_close(*data_read_fd);
|
||||
ws_close(*message_read_fd);
|
||||
return -1;
|
||||
|
@ -1352,9 +1352,9 @@ pipe_read_bytes(int pipe_fd, char *bytes, int required, char **msg)
|
|||
error = errno;
|
||||
g_log(LOG_DOMAIN_CAPTURE, G_LOG_LEVEL_DEBUG,
|
||||
"read from pipe %d: error(%u): %s", pipe_fd, error,
|
||||
strerror(error));
|
||||
g_strerror(error));
|
||||
*msg = g_strdup_printf("Error reading from sync pipe: %s",
|
||||
strerror(error));
|
||||
g_strerror(error));
|
||||
return newly;
|
||||
}
|
||||
|
||||
|
@ -1413,7 +1413,7 @@ sync_pipe_gets_nonblock(int pipe_fd, char *bytes, int max) {
|
|||
} else if (newly < 0) {
|
||||
/* error */
|
||||
g_log(LOG_DOMAIN_CAPTURE, G_LOG_LEVEL_DEBUG,
|
||||
"read from pipe %d: error(%u): %s", pipe_fd, errno, strerror(errno));
|
||||
"read from pipe %d: error(%u): %s", pipe_fd, errno, g_strerror(errno));
|
||||
return newly;
|
||||
} else if (bytes[offset] == '\n') {
|
||||
break;
|
||||
|
@ -1654,7 +1654,7 @@ sync_pipe_wait_for_child(int fork_child, gchar **msgp)
|
|||
ret = 0;
|
||||
#ifdef _WIN32
|
||||
if (_cwait(&fork_child_status, fork_child, _WAIT_CHILD) == -1) {
|
||||
*msgp = g_strdup_printf("Error from cwait(): %s", strerror(errno));
|
||||
*msgp = g_strdup_printf("Error from cwait(): %s", g_strerror(errno));
|
||||
ret = -1;
|
||||
} else {
|
||||
/*
|
||||
|
@ -1696,7 +1696,7 @@ sync_pipe_wait_for_child(int fork_child, gchar **msgp)
|
|||
ret = -1;
|
||||
}
|
||||
} else {
|
||||
*msgp = g_strdup_printf("Error from waitpid(): %s", strerror(errno));
|
||||
*msgp = g_strdup_printf("Error from waitpid(): %s", g_strerror(errno));
|
||||
ret = -1;
|
||||
}
|
||||
#endif
|
||||
|
@ -1820,7 +1820,7 @@ signal_pipe_capquit_to_child(capture_options *capture_opts)
|
|||
ret = write(capture_opts->signal_pipe_write_fd, quit_msg, sizeof quit_msg);
|
||||
if(ret == -1) {
|
||||
g_log(LOG_DOMAIN_CAPTURE_CHILD, G_LOG_LEVEL_WARNING,
|
||||
"signal_pipe_capquit_to_child: %d header: error %s", capture_opts->signal_pipe_write_fd, strerror(errno));
|
||||
"signal_pipe_capquit_to_child: %d header: error %s", capture_opts->signal_pipe_write_fd, g_strerror(errno));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -1842,7 +1842,7 @@ sync_pipe_stop(capture_options *capture_opts)
|
|||
int sts = kill(capture_opts->fork_child, SIGINT);
|
||||
if (sts != 0) {
|
||||
g_log(LOG_DOMAIN_CAPTURE_CHILD, G_LOG_LEVEL_WARNING,
|
||||
"Sending SIGINT to child failed: %s\n", strerror(errno));
|
||||
"Sending SIGINT to child failed: %s\n", g_strerror(errno));
|
||||
}
|
||||
#else
|
||||
#define STOP_SLEEP_TIME 500 /* ms */
|
||||
|
@ -1882,7 +1882,7 @@ sync_pipe_kill(int fork_child)
|
|||
int sts = kill(fork_child, SIGTERM); /* SIGTERM so it can clean up if necessary */
|
||||
if (sts != 0) {
|
||||
g_log(LOG_DOMAIN_CAPTURE_CHILD, G_LOG_LEVEL_WARNING,
|
||||
"Sending SIGTERM to child failed: %s\n", strerror(errno));
|
||||
"Sending SIGTERM to child failed: %s\n", g_strerror(errno));
|
||||
}
|
||||
#else
|
||||
/* Remark: This is not the preferred method of closing a process!
|
||||
|
|
|
@ -306,9 +306,6 @@
|
|||
/* Define if inet/v6defs.h needs to be included */
|
||||
#cmakedefine NEED_INET_V6DEFS_H 1
|
||||
|
||||
/* Define if strerror.h needs to be included */
|
||||
#cmakedefine NEED_STRERROR_H 1
|
||||
|
||||
/* Define if strptime.h needs to be included */
|
||||
#cmakedefine NEED_STRPTIME_H 1
|
||||
|
||||
|
|
|
@ -634,7 +634,7 @@ read_users_filters(GSList **cfl)
|
|||
if (errno != ENOENT) {
|
||||
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
|
||||
"Could not open filter file\n\"%s\": %s.", path,
|
||||
strerror(errno));
|
||||
g_strerror(errno));
|
||||
}
|
||||
g_free(path);
|
||||
return FALSE;
|
||||
|
@ -661,7 +661,7 @@ color_filters_read_globals(gpointer user_data)
|
|||
if (errno != ENOENT) {
|
||||
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
|
||||
"Could not open global filter file\n\"%s\": %s.", path,
|
||||
strerror(errno));
|
||||
g_strerror(errno));
|
||||
}
|
||||
g_free(path);
|
||||
return FALSE;
|
||||
|
@ -684,7 +684,7 @@ color_filters_import(gchar *path, gpointer user_data)
|
|||
if ((f = ws_fopen(path, "r")) == NULL) {
|
||||
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
|
||||
"Could not open\n%s\nfor reading: %s.",
|
||||
path, strerror(errno));
|
||||
path, g_strerror(errno));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -749,7 +749,7 @@ color_filters_write(GSList *cfl)
|
|||
if (create_persconffile_dir(&pf_dir_path) == -1) {
|
||||
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
|
||||
"Can't create directory\n\"%s\"\nfor color files: %s.",
|
||||
pf_dir_path, strerror(errno));
|
||||
pf_dir_path, g_strerror(errno));
|
||||
g_free(pf_dir_path);
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -758,7 +758,7 @@ color_filters_write(GSList *cfl)
|
|||
if ((f = ws_fopen(path, "w+")) == NULL) {
|
||||
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
|
||||
"Could not open\n%s\nfor writing: %s.",
|
||||
path, strerror(errno));
|
||||
path, g_strerror(errno));
|
||||
g_free(path);
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -777,7 +777,7 @@ color_filters_export(gchar *path, GSList *cfl, gboolean only_marked)
|
|||
if ((f = ws_fopen(path, "w+")) == NULL) {
|
||||
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
|
||||
"Could not open\n%s\nfor writing: %s.",
|
||||
path, strerror(errno));
|
||||
path, g_strerror(errno));
|
||||
return FALSE;
|
||||
}
|
||||
write_filters_file(cfl, f, only_marked);
|
||||
|
|
|
@ -43,8 +43,6 @@
|
|||
|
||||
/* #undef HAVE_SA_LEN */
|
||||
|
||||
/* #undef NEED_STRERROR_H */
|
||||
|
||||
/* #undef HAVE_MKSTEMP */
|
||||
/* #undef HAVE_MKDTEMP */
|
||||
|
||||
|
|
10
configure.in
10
configure.in
|
@ -1754,16 +1754,6 @@ fi
|
|||
AM_CONDITIONAL(NEED_GETOPT_LO, test "x$ac_cv_func_getopt" = "xno")
|
||||
AC_SUBST(GETOPT_LO)
|
||||
|
||||
AC_CHECK_FUNC(strerror, STRERROR_LO="",
|
||||
[STRERROR_LO="strerror.lo"
|
||||
AC_DEFINE(NEED_STRERROR_H, 1, [Define if strerror.h needs to be included])
|
||||
])
|
||||
if test "$ac_cv_func_strerror" = no ; then
|
||||
STRERROR_LO="strerror.lo"
|
||||
fi
|
||||
AM_CONDITIONAL(NEED_STRERROR_LO, test "x$ac_cv_func_strerror" = "xno")
|
||||
AC_SUBST(STRERROR_LO)
|
||||
|
||||
AC_CHECK_FUNC(strncasecmp, STRNCASECMP_LO="",
|
||||
STRNCASECMP_LO="strncasecmp.lo")
|
||||
if test "$ac_cv_func_strncasecmp" = no ; then
|
||||
|
|
16
dftest.c
16
dftest.c
|
@ -32,10 +32,6 @@
|
|||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
||||
#ifdef NEED_STRERROR_H
|
||||
#include "wsutil/strerror.h"
|
||||
#endif
|
||||
|
||||
#include <glib.h>
|
||||
#include <epan/epan.h>
|
||||
|
||||
|
@ -103,24 +99,24 @@ main(int argc, char **argv)
|
|||
if (gpf_open_errno != 0) {
|
||||
fprintf(stderr,
|
||||
"can't open global preferences file \"%s\": %s.\n",
|
||||
pf_path, strerror(gpf_open_errno));
|
||||
pf_path, g_strerror(gpf_open_errno));
|
||||
}
|
||||
if (gpf_read_errno != 0) {
|
||||
fprintf(stderr,
|
||||
"I/O error reading global preferences file \"%s\": %s.\n",
|
||||
pf_path, strerror(gpf_read_errno));
|
||||
pf_path, g_strerror(gpf_read_errno));
|
||||
}
|
||||
}
|
||||
if (pf_path != NULL) {
|
||||
if (pf_open_errno != 0) {
|
||||
fprintf(stderr,
|
||||
"can't open your preferences file \"%s\": %s.\n",
|
||||
pf_path, strerror(pf_open_errno));
|
||||
pf_path, g_strerror(pf_open_errno));
|
||||
}
|
||||
if (pf_read_errno != 0) {
|
||||
fprintf(stderr,
|
||||
"I/O error reading your preferences file \"%s\": %s.\n",
|
||||
pf_path, strerror(pf_read_errno));
|
||||
pf_path, g_strerror(pf_read_errno));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -189,7 +185,7 @@ static void
|
|||
read_failure_message(const char *filename, int err)
|
||||
{
|
||||
fprintf(stderr, "dftest: An error occurred while reading from the file \"%s\": %s.\n",
|
||||
filename, strerror(err));
|
||||
filename, g_strerror(err));
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -199,5 +195,5 @@ static void
|
|||
write_failure_message(const char *filename, int err)
|
||||
{
|
||||
fprintf(stderr, "dftest: An error occurred while writing to the file \"%s\": %s.\n",
|
||||
filename, strerror(err));
|
||||
filename, g_strerror(err));
|
||||
}
|
||||
|
|
46
dumpcap.c
46
dumpcap.c
|
@ -539,7 +539,7 @@ relinquish_all_capabilities(void)
|
|||
cap_t caps = cap_init(); /* all capabilities initialized to off */
|
||||
print_caps("Pre-clear");
|
||||
if (cap_set_proc(caps)) {
|
||||
cmdarg_err("cap_set_proc() fail return: %s", strerror(errno));
|
||||
cmdarg_err("cap_set_proc() fail return: %s", g_strerror(errno));
|
||||
}
|
||||
print_caps("Post-clear");
|
||||
cap_free(caps);
|
||||
|
@ -1467,14 +1467,14 @@ relinquish_privs_except_capture(void)
|
|||
print_caps("Pre drop, pre set");
|
||||
|
||||
if (prctl(PR_SET_KEEPCAPS, 1, 0, 0, 0) == -1) {
|
||||
cmdarg_err("prctl() fail return: %s", strerror(errno));
|
||||
cmdarg_err("prctl() fail return: %s", g_strerror(errno));
|
||||
}
|
||||
|
||||
cap_set_flag(caps, CAP_PERMITTED, cl_len, cap_list, CAP_SET);
|
||||
cap_set_flag(caps, CAP_INHERITABLE, cl_len, cap_list, CAP_SET);
|
||||
|
||||
if (cap_set_proc(caps)) {
|
||||
cmdarg_err("cap_set_proc() fail return: %s", strerror(errno));
|
||||
cmdarg_err("cap_set_proc() fail return: %s", g_strerror(errno));
|
||||
}
|
||||
print_caps("Pre drop, post set");
|
||||
|
||||
|
@ -1483,7 +1483,7 @@ relinquish_privs_except_capture(void)
|
|||
print_caps("Post drop, pre set");
|
||||
cap_set_flag(caps, CAP_EFFECTIVE, cl_len, cap_list, CAP_SET);
|
||||
if (cap_set_proc(caps)) {
|
||||
cmdarg_err("cap_set_proc() fail return: %s", strerror(errno));
|
||||
cmdarg_err("cap_set_proc() fail return: %s", g_strerror(errno));
|
||||
}
|
||||
print_caps("Post drop, post set");
|
||||
|
||||
|
@ -1688,7 +1688,7 @@ cap_pipe_open_live(char *pipename,
|
|||
else {
|
||||
g_snprintf(errmsg, errmsgl,
|
||||
"The capture session could not be initiated "
|
||||
"due to error getting information on pipe/socket: %s", strerror(errno));
|
||||
"due to error getting information on pipe/socket: %s", g_strerror(errno));
|
||||
pcap_opts->cap_pipe_err = PIPERR;
|
||||
}
|
||||
return;
|
||||
|
@ -1698,7 +1698,7 @@ cap_pipe_open_live(char *pipename,
|
|||
if (fd == -1) {
|
||||
g_snprintf(errmsg, errmsgl,
|
||||
"The capture session could not be initiated "
|
||||
"due to error on pipe open: %s", strerror(errno));
|
||||
"due to error on pipe open: %s", g_strerror(errno));
|
||||
pcap_opts->cap_pipe_err = PIPERR;
|
||||
return;
|
||||
}
|
||||
|
@ -1707,7 +1707,7 @@ cap_pipe_open_live(char *pipename,
|
|||
if (fd == -1) {
|
||||
g_snprintf(errmsg, errmsgl,
|
||||
"The capture session could not be initiated "
|
||||
"due to error on socket create: %s", strerror(errno));
|
||||
"due to error on socket create: %s", g_strerror(errno));
|
||||
pcap_opts->cap_pipe_err = PIPERR;
|
||||
return;
|
||||
}
|
||||
|
@ -1747,7 +1747,7 @@ cap_pipe_open_live(char *pipename,
|
|||
if (b == -1) {
|
||||
g_snprintf(errmsg, errmsgl,
|
||||
"The capture session coud not be initiated "
|
||||
"due to error on socket connect: %s", strerror(errno));
|
||||
"due to error on socket connect: %s", g_strerror(errno));
|
||||
pcap_opts->cap_pipe_err = PIPERR;
|
||||
return;
|
||||
}
|
||||
|
@ -1833,7 +1833,7 @@ cap_pipe_open_live(char *pipename,
|
|||
sel_ret = cap_pipe_select(fd);
|
||||
if (sel_ret < 0) {
|
||||
g_snprintf(errmsg, errmsgl,
|
||||
"Unexpected error from select: %s", strerror(errno));
|
||||
"Unexpected error from select: %s", g_strerror(errno));
|
||||
goto error;
|
||||
} else if (sel_ret > 0) {
|
||||
b = read(fd, ((char *)&magic)+bytes_read, sizeof magic-bytes_read);
|
||||
|
@ -1842,7 +1842,7 @@ cap_pipe_open_live(char *pipename,
|
|||
g_snprintf(errmsg, errmsgl, "End of file on pipe magic during open");
|
||||
else
|
||||
g_snprintf(errmsg, errmsgl, "Error on pipe magic during open: %s",
|
||||
strerror(errno));
|
||||
g_strerror(errno));
|
||||
goto error;
|
||||
}
|
||||
bytes_read += b;
|
||||
|
@ -1862,7 +1862,7 @@ cap_pipe_open_live(char *pipename,
|
|||
g_snprintf(errmsg, errmsgl, "End of file on pipe magic during open");
|
||||
else
|
||||
g_snprintf(errmsg, errmsgl, "Error on pipe magic during open: %s",
|
||||
strerror(errno));
|
||||
g_strerror(errno));
|
||||
goto error;
|
||||
}
|
||||
|
||||
|
@ -1908,7 +1908,7 @@ cap_pipe_open_live(char *pipename,
|
|||
sel_ret = cap_pipe_select(fd);
|
||||
if (sel_ret < 0) {
|
||||
g_snprintf(errmsg, errmsgl,
|
||||
"Unexpected error from select: %s", strerror(errno));
|
||||
"Unexpected error from select: %s", g_strerror(errno));
|
||||
goto error;
|
||||
} else if (sel_ret > 0) {
|
||||
b = read(fd, ((char *)hdr)+bytes_read,
|
||||
|
@ -1918,7 +1918,7 @@ cap_pipe_open_live(char *pipename,
|
|||
g_snprintf(errmsg, errmsgl, "End of file on pipe header during open");
|
||||
else
|
||||
g_snprintf(errmsg, errmsgl, "Error on pipe header during open: %s",
|
||||
strerror(errno));
|
||||
g_strerror(errno));
|
||||
goto error;
|
||||
}
|
||||
bytes_read += b;
|
||||
|
@ -1935,7 +1935,7 @@ cap_pipe_open_live(char *pipename,
|
|||
g_snprintf(errmsg, errmsgl, "End of file on pipe header during open");
|
||||
else
|
||||
g_snprintf(errmsg, errmsgl, "Error on pipe header header during open: %s",
|
||||
strerror(errno));
|
||||
g_strerror(errno));
|
||||
goto error;
|
||||
}
|
||||
#endif /* USE_THREADS */
|
||||
|
@ -2148,7 +2148,7 @@ cap_pipe_dispatch(loop_data *ld, pcap_options *pcap_opts, guchar *data, char *er
|
|||
LocalFree(err_str);
|
||||
#else
|
||||
g_snprintf(errmsg, errmsgl, "Error reading from pipe: %s",
|
||||
strerror(errno));
|
||||
g_strerror(errno));
|
||||
#endif
|
||||
/* Fall through */
|
||||
case PD_ERR:
|
||||
|
@ -2554,7 +2554,7 @@ capture_loop_init_output(capture_options *capture_opts, loop_data *ld, char *err
|
|||
g_snprintf(errmsg, errmsg_len,
|
||||
"The file to which the capture would be"
|
||||
" saved (\"%s\") could not be opened: %s.",
|
||||
capture_opts->save_file, strerror(err));
|
||||
capture_opts->save_file, g_strerror(err));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -2622,7 +2622,7 @@ capture_loop_dispatch(loop_data *ld,
|
|||
if (sel_ret <= 0) {
|
||||
if (sel_ret < 0 && errno != EINTR) {
|
||||
g_snprintf(errmsg, errmsg_len,
|
||||
"Unexpected error from select: %s", strerror(errno));
|
||||
"Unexpected error from select: %s", g_strerror(errno));
|
||||
report_capture_error(errmsg, please_report);
|
||||
ld->go = FALSE;
|
||||
}
|
||||
|
@ -2686,7 +2686,7 @@ capture_loop_dispatch(loop_data *ld,
|
|||
} else {
|
||||
if (sel_ret < 0 && errno != EINTR) {
|
||||
g_snprintf(errmsg, errmsg_len,
|
||||
"Unexpected error from select: %s", strerror(errno));
|
||||
"Unexpected error from select: %s", g_strerror(errno));
|
||||
report_capture_error(errmsg, please_report);
|
||||
ld->go = FALSE;
|
||||
}
|
||||
|
@ -2882,7 +2882,7 @@ capture_loop_open_output(capture_options *capture_opts, int *save_file_fd,
|
|||
if (is_tempfile) {
|
||||
g_snprintf(errmsg, errmsg_len,
|
||||
"The temporary file to which the capture would be saved (\"%s\") "
|
||||
"could not be opened: %s.", capfile_name, strerror(errno));
|
||||
"could not be opened: %s.", capfile_name, g_strerror(errno));
|
||||
} else {
|
||||
if (capture_opts->multi_files_on) {
|
||||
ringbuf_error_cleanup();
|
||||
|
@ -2891,7 +2891,7 @@ capture_loop_open_output(capture_options *capture_opts, int *save_file_fd,
|
|||
g_snprintf(errmsg, errmsg_len,
|
||||
"The file to which the capture would be saved (\"%s\") "
|
||||
"could not be opened: %s.", capfile_name,
|
||||
strerror(errno));
|
||||
g_strerror(errno));
|
||||
}
|
||||
g_free(capfile_name);
|
||||
return FALSE;
|
||||
|
@ -3337,7 +3337,7 @@ capture_loop_start(capture_options *capture_opts, gboolean *stats_known, struct
|
|||
/* On Linux, if an interface goes down while you're capturing on it,
|
||||
you'll get a "recvfrom: Network is down" or
|
||||
"The interface went down" error (ENETDOWN).
|
||||
(At least you will if strerror() doesn't show a local translation
|
||||
(At least you will if g_strerror() doesn't show a local translation
|
||||
of the error.)
|
||||
|
||||
On FreeBSD and OS X, if a network adapter disappears while
|
||||
|
@ -3527,13 +3527,13 @@ capture_loop_get_errmsg(char *errmsg, int errmsglen, const char *fname,
|
|||
g_snprintf(errmsg, errmsglen,
|
||||
"The file to which the capture was being saved\n"
|
||||
"(\"%s\") could not be closed: %s.",
|
||||
fname, strerror(err));
|
||||
fname, g_strerror(err));
|
||||
} else {
|
||||
g_snprintf(errmsg, errmsglen,
|
||||
"An error occurred while writing to the file"
|
||||
" to which the capture was being saved\n"
|
||||
"(\"%s\"): %s.",
|
||||
fname, strerror(err));
|
||||
fname, g_strerror(err));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -115,7 +115,7 @@ void dfilter_macro_save(const gchar* filename, gchar** error) {
|
|||
FILE* f = ws_fopen(filename,"w");
|
||||
|
||||
if (!f) {
|
||||
*error = ep_strdup_printf("Could not open file: '%s', error: %s\n", filename, strerror(errno) );
|
||||
*error = ep_strdup_printf("Could not open file: '%s', error: %s\n", filename, g_strerror(errno) );
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -275,7 +275,7 @@ description_attr description=\042
|
|||
D(("entity: %s filename: %s yyin: %p\n",e->name,e->file,yyin));
|
||||
if (!yyin) {
|
||||
if (errno) {
|
||||
fprintf(stderr, "Could not open file: '%s', error: %s\n", e->file, strerror(errno) );
|
||||
fprintf(stderr, "Could not open file: '%s', error: %s\n", e->file, g_strerror(errno) );
|
||||
yyterminate();
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -288,9 +288,6 @@
|
|||
#include <ctype.h>
|
||||
#include <glib.h>
|
||||
#include <math.h>
|
||||
#ifdef NEED_STRERROR_H
|
||||
#include "wsutil/strerror.h"
|
||||
#endif
|
||||
|
||||
#include "isprint.h"
|
||||
|
||||
|
@ -1321,7 +1318,7 @@ static void read_IOR_strings_from_file(const gchar *name, int max_iorlen) {
|
|||
|
||||
if (fp == NULL) {
|
||||
if (errno == EACCES)
|
||||
fprintf(stderr, "Error opening file %s for reading: %s\n", name, strerror(errno));
|
||||
fprintf(stderr, "Error opening file %s for reading: %s\n", name, g_strerror(errno));
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -200,7 +200,7 @@ extern GString* dtd_preparse(const gchar* dname,const gchar* fname, GString* er
|
|||
|
||||
if (!yyin) {
|
||||
if (err)
|
||||
g_string_append_printf(err, "Could not open file: '%s', error: %s",fullname,strerror(errno));
|
||||
g_string_append_printf(err, "Could not open file: '%s', error: %s",fullname,g_strerror(errno));
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
@ -395,7 +395,7 @@ init_progfile_dir(const char *arg0
|
|||
* allocate for the current directory.
|
||||
*/
|
||||
return g_strdup_printf("pathconf failed: %s\n",
|
||||
strerror(errno));
|
||||
g_strerror(errno));
|
||||
}
|
||||
curdir = (char *)g_malloc(path_max);
|
||||
if (getcwd(curdir, path_max) == NULL) {
|
||||
|
@ -405,7 +405,7 @@ init_progfile_dir(const char *arg0
|
|||
*/
|
||||
g_free(curdir);
|
||||
return g_strdup_printf("getcwd failed: %s\n",
|
||||
strerror(errno));
|
||||
g_strerror(errno));
|
||||
}
|
||||
path = g_strdup_printf("%s/%s", curdir, arg0);
|
||||
g_free(curdir);
|
||||
|
@ -1650,7 +1650,7 @@ file_open_error_message(int err, gboolean for_writing)
|
|||
g_snprintf(errmsg_errno, sizeof(errmsg_errno),
|
||||
"The file \"%%s\" could not be %s: %s.",
|
||||
for_writing ? "created" : "opened",
|
||||
strerror(err));
|
||||
g_strerror(err));
|
||||
errmsg = errmsg_errno;
|
||||
break;
|
||||
}
|
||||
|
@ -1686,7 +1686,7 @@ file_write_error_message(int err)
|
|||
default:
|
||||
g_snprintf(errmsg_errno, sizeof(errmsg_errno),
|
||||
"An error occurred while writing to the file \"%%s\": %s.",
|
||||
strerror(err));
|
||||
g_strerror(err));
|
||||
errmsg = errmsg_errno;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -267,7 +267,7 @@
|
|||
|
||||
if (!yyin) {
|
||||
if (errno) {
|
||||
g_string_append_printf(error, "Could not open file: '%s', error: %s\n", fullpaths[include_stack_ptr], strerror(errno) );
|
||||
g_string_append_printf(error, "Could not open file: '%s', error: %s\n", fullpaths[include_stack_ptr], g_strerror(errno) );
|
||||
yyterminate();
|
||||
}
|
||||
} else {
|
||||
|
@ -583,7 +583,7 @@ gboolean radius_load_dictionary (radius_dictionary_t* d, gchar* dir, const gchar
|
|||
yyin = ws_fopen(fullpaths[include_stack_ptr],"r");
|
||||
|
||||
if (!yyin) {
|
||||
g_string_append_printf(error, "Could not open file: '%s', error: %s\n", fullpaths[include_stack_ptr], strerror(errno) );
|
||||
g_string_append_printf(error, "Could not open file: '%s', error: %s\n", fullpaths[include_stack_ptr], g_strerror(errno) );
|
||||
g_free(fullpaths[include_stack_ptr]);
|
||||
*err_str = error->str;
|
||||
g_string_free(error,FALSE);
|
||||
|
|
|
@ -262,7 +262,7 @@ gboolean uat_save(uat_t* uat, char** error) {
|
|||
}
|
||||
|
||||
if (!fp) {
|
||||
*error = ep_strdup_printf("uat_save: error opening '%s': %s",fname,strerror(errno));
|
||||
*error = ep_strdup_printf("uat_save: error opening '%s': %s",fname,g_strerror(errno));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -449,7 +449,7 @@ gboolean uat_fld_chk_num_dec(void* u1 _U_, const char* strptr, unsigned len, con
|
|||
long i = strtol(str,&str,10);
|
||||
|
||||
if ( ( i == 0) && (errno == ERANGE || errno == EINVAL) ) {
|
||||
*err = strerror(errno);
|
||||
*err = g_strerror(errno);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
@ -464,7 +464,7 @@ gboolean uat_fld_chk_num_hex(void* u1 _U_, const char* strptr, unsigned len, con
|
|||
long i = strtol(str,&str,16);
|
||||
|
||||
if ( ( i == 0) && (errno == ERANGE || errno == EINVAL) ) {
|
||||
*err = strerror(errno);
|
||||
*err = g_strerror(errno);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -285,7 +285,7 @@ gboolean uat_load(uat_t* uat_in, char** err) {
|
|||
|
||||
|
||||
if (!(yyin = ws_fopen(fname,"r"))) {
|
||||
*err = strerror(errno);
|
||||
*err = g_strerror(errno);
|
||||
g_free(fname);
|
||||
return FALSE;
|
||||
}
|
||||
|
|
|
@ -84,7 +84,7 @@ write_prefs_to_file(void)
|
|||
if (create_persconffile_dir(&pf_dir_path) == -1) {
|
||||
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
|
||||
"Can't create directory\n\"%s\"\nfor preferences file: %s.", pf_dir_path,
|
||||
strerror(errno));
|
||||
g_strerror(errno));
|
||||
g_free(pf_dir_path);
|
||||
} else {
|
||||
/* Write the preferencs out. */
|
||||
|
@ -92,7 +92,7 @@ write_prefs_to_file(void)
|
|||
if (err != 0) {
|
||||
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
|
||||
"Can't open preferences file\n\"%s\": %s.", pf_path,
|
||||
strerror(err));
|
||||
g_strerror(err));
|
||||
g_free(pf_path);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1080,7 +1080,7 @@ color_apply_cb(GtkButton *button _U_, gpointer user_data _U_)
|
|||
if (!prefs.gui_use_pref_save) {
|
||||
if (!color_filters_write(color_filter_edit_list))
|
||||
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
|
||||
"Could not open filter file: %s", strerror(errno));
|
||||
"Could not open filter file: %s", g_strerror(errno));
|
||||
}
|
||||
|
||||
/* Apply the coloring rules, both the temporary ones in
|
||||
|
@ -1100,7 +1100,7 @@ color_save_cb(GtkButton *button _U_, gpointer user_data _U_)
|
|||
|
||||
if (!color_filters_write(color_filter_edit_list))
|
||||
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
|
||||
"Could not open filter file: %s", strerror(errno));
|
||||
"Could not open filter file: %s", g_strerror(errno));
|
||||
}
|
||||
|
||||
/* User pressed "Cancel" button (or "ESC" or the 'X'):
|
||||
|
|
|
@ -837,7 +837,7 @@ filter_dlg_save(filter_list_type_t list_type)
|
|||
if (create_persconffile_dir(&pf_dir_path) == -1) {
|
||||
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
|
||||
"Can't create directory\n\"%s\"\nfor filter files: %s.",
|
||||
pf_dir_path, strerror(errno));
|
||||
pf_dir_path, g_strerror(errno));
|
||||
g_free(pf_dir_path);
|
||||
return;
|
||||
}
|
||||
|
@ -847,7 +847,7 @@ filter_dlg_save(filter_list_type_t list_type)
|
|||
/* We had an error saving the filter. */
|
||||
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
|
||||
"Could not save to your %s filter file\n\"%s\": %s.",
|
||||
filter_type, f_path, strerror(f_save_errno));
|
||||
filter_type, f_path, g_strerror(f_save_errno));
|
||||
g_free(f_path);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -503,7 +503,7 @@ follow_print_stream(GtkWidget * w _U_, gpointer data)
|
|||
} else {
|
||||
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
|
||||
"Error writing to print command: %s",
|
||||
strerror(errno));
|
||||
g_strerror(errno));
|
||||
}
|
||||
/* XXX - cancel printing? */
|
||||
destroy_print_stream(stream);
|
||||
|
@ -941,7 +941,7 @@ follow_destroy_cb(GtkWidget *w, gpointer data _U_)
|
|||
case FOLLOW_TCP :
|
||||
i = ws_unlink(follow_info->data_out_filename);
|
||||
if(i != 0) {
|
||||
g_warning("Follow: Couldn't remove temporary file: \"%s\", errno: %s (%u)", follow_info->data_out_filename, strerror(errno), errno);
|
||||
g_warning("Follow: Couldn't remove temporary file: \"%s\", errno: %s (%u)", follow_info->data_out_filename, g_strerror(errno), errno);
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
|
@ -145,7 +145,7 @@ follow_tcp_stream_cb(GtkWidget * w _U_, gpointer data _U_)
|
|||
if (tmp_fd == -1) {
|
||||
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
|
||||
"Could not create temporary file %s: %s",
|
||||
follow_info->data_out_filename, strerror(errno));
|
||||
follow_info->data_out_filename, g_strerror(errno));
|
||||
g_free(follow_info->data_out_filename);
|
||||
g_free(follow_info);
|
||||
g_free(follow_filter);
|
||||
|
@ -156,7 +156,7 @@ follow_tcp_stream_cb(GtkWidget * w _U_, gpointer data _U_)
|
|||
if (data_out_file == NULL) {
|
||||
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
|
||||
"Could not create temporary file %s: %s",
|
||||
follow_info->data_out_filename, strerror(errno));
|
||||
follow_info->data_out_filename, g_strerror(errno));
|
||||
ws_close(tmp_fd);
|
||||
ws_unlink(follow_info->data_out_filename);
|
||||
g_free(follow_info->data_out_filename);
|
||||
|
@ -227,7 +227,7 @@ follow_tcp_stream_cb(GtkWidget * w _U_, gpointer data _U_)
|
|||
if (ferror(data_out_file)) {
|
||||
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
|
||||
"Could not read from temporary file %s: %s",
|
||||
follow_info->data_out_filename, strerror(errno));
|
||||
follow_info->data_out_filename, g_strerror(errno));
|
||||
} else {
|
||||
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
|
||||
"Short read from temporary file %s: expected %lu, got %lu",
|
||||
|
@ -358,7 +358,7 @@ follow_read_tcp_stream(follow_info_t *follow_info,
|
|||
if (data_out_file == NULL) {
|
||||
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
|
||||
"Could not open temporary file %s: %s", follow_info->data_out_filename,
|
||||
strerror(errno));
|
||||
g_strerror(errno));
|
||||
return FRS_OPEN_ERROR;
|
||||
}
|
||||
|
||||
|
@ -421,7 +421,7 @@ follow_read_tcp_stream(follow_info_t *follow_info,
|
|||
if (ferror(data_out_file)) {
|
||||
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
|
||||
"Error reading temporary file %s: %s", follow_info->data_out_filename,
|
||||
strerror(errno));
|
||||
g_strerror(errno));
|
||||
fclose(data_out_file);
|
||||
data_out_file = NULL;
|
||||
return FRS_READ_ERROR;
|
||||
|
|
|
@ -510,7 +510,7 @@ static gboolean funnel_open_file(const char* fname, const char* filter, const ch
|
|||
|
||||
|
||||
if (cf_open(&cfile, fname, FALSE, &err) != CF_OK) {
|
||||
*err_str = strerror(err);
|
||||
*err_str = g_strerror(err);
|
||||
if (rfcode != NULL) dfilter_free(rfcode);
|
||||
return FALSE;
|
||||
}
|
||||
|
|
36
gtk/main.c
36
gtk/main.c
|
@ -45,10 +45,6 @@
|
|||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef NEED_STRERROR_H
|
||||
#include "wsutil/strerror.h"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_GETOPT_H
|
||||
#include <getopt.h>
|
||||
#else
|
||||
|
@ -1871,24 +1867,24 @@ read_configuration_files(char **gdp_path, char **dp_path)
|
|||
if (gpf_open_errno != 0) {
|
||||
simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK,
|
||||
"Could not open global preferences file\n\"%s\": %s.", gpf_path,
|
||||
strerror(gpf_open_errno));
|
||||
g_strerror(gpf_open_errno));
|
||||
}
|
||||
if (gpf_read_errno != 0) {
|
||||
simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK,
|
||||
"I/O error reading global preferences file\n\"%s\": %s.", gpf_path,
|
||||
strerror(gpf_read_errno));
|
||||
g_strerror(gpf_read_errno));
|
||||
}
|
||||
}
|
||||
if (pf_path != NULL) {
|
||||
if (pf_open_errno != 0) {
|
||||
simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK,
|
||||
"Could not open your preferences file\n\"%s\": %s.", pf_path,
|
||||
strerror(pf_open_errno));
|
||||
g_strerror(pf_open_errno));
|
||||
}
|
||||
if (pf_read_errno != 0) {
|
||||
simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK,
|
||||
"I/O error reading your preferences file\n\"%s\": %s.", pf_path,
|
||||
strerror(pf_read_errno));
|
||||
g_strerror(pf_read_errno));
|
||||
}
|
||||
g_free(pf_path);
|
||||
pf_path = NULL;
|
||||
|
@ -1906,7 +1902,7 @@ read_configuration_files(char **gdp_path, char **dp_path)
|
|||
if (cf_path != NULL) {
|
||||
simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK,
|
||||
"Could not open your capture filter file\n\"%s\": %s.", cf_path,
|
||||
strerror(cf_open_errno));
|
||||
g_strerror(cf_open_errno));
|
||||
g_free(cf_path);
|
||||
}
|
||||
|
||||
|
@ -1915,7 +1911,7 @@ read_configuration_files(char **gdp_path, char **dp_path)
|
|||
if (df_path != NULL) {
|
||||
simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK,
|
||||
"Could not open your display filter file\n\"%s\": %s.", df_path,
|
||||
strerror(df_open_errno));
|
||||
g_strerror(df_open_errno));
|
||||
g_free(df_path);
|
||||
}
|
||||
|
||||
|
@ -1926,12 +1922,12 @@ read_configuration_files(char **gdp_path, char **dp_path)
|
|||
if (gdp_open_errno != 0) {
|
||||
simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK,
|
||||
"Could not open global disabled protocols file\n\"%s\": %s.",
|
||||
*gdp_path, strerror(gdp_open_errno));
|
||||
*gdp_path, g_strerror(gdp_open_errno));
|
||||
}
|
||||
if (gdp_read_errno != 0) {
|
||||
simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK,
|
||||
"I/O error reading global disabled protocols file\n\"%s\": %s.",
|
||||
*gdp_path, strerror(gdp_read_errno));
|
||||
*gdp_path, g_strerror(gdp_read_errno));
|
||||
}
|
||||
g_free(*gdp_path);
|
||||
*gdp_path = NULL;
|
||||
|
@ -1940,12 +1936,12 @@ read_configuration_files(char **gdp_path, char **dp_path)
|
|||
if (dp_open_errno != 0) {
|
||||
simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK,
|
||||
"Could not open your disabled protocols file\n\"%s\": %s.", *dp_path,
|
||||
strerror(dp_open_errno));
|
||||
g_strerror(dp_open_errno));
|
||||
}
|
||||
if (dp_read_errno != 0) {
|
||||
simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK,
|
||||
"I/O error reading your disabled protocols file\n\"%s\": %s.", *dp_path,
|
||||
strerror(dp_read_errno));
|
||||
g_strerror(dp_read_errno));
|
||||
}
|
||||
g_free(*dp_path);
|
||||
*dp_path = NULL;
|
||||
|
@ -2159,7 +2155,7 @@ main(int argc, char *argv[])
|
|||
if (rf_path != NULL && rf_open_errno != 0) {
|
||||
simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK,
|
||||
"Could not open common recent file\n\"%s\": %s.",
|
||||
rf_path, strerror(rf_open_errno));
|
||||
rf_path, g_strerror(rf_open_errno));
|
||||
}
|
||||
|
||||
/* "pre-scan" the command line parameters, if we have "console only"
|
||||
|
@ -2254,7 +2250,7 @@ main(int argc, char *argv[])
|
|||
if (rf_path != NULL && rf_open_errno != 0) {
|
||||
simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK,
|
||||
"Could not open recent file\n\"%s\": %s.",
|
||||
rf_path, strerror(rf_open_errno));
|
||||
rf_path, g_strerror(rf_open_errno));
|
||||
}
|
||||
|
||||
if (recent.gui_fileopen_remembered_dir &&
|
||||
|
@ -2789,7 +2785,7 @@ main(int argc, char *argv[])
|
|||
if (rf_path != NULL && rf_open_errno != 0) {
|
||||
simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK,
|
||||
"Could not open recent file\n\"%s\": %s.",
|
||||
rf_path, strerror(rf_open_errno));
|
||||
rf_path, g_strerror(rf_open_errno));
|
||||
}
|
||||
|
||||
color_filters_enable(recent.packet_list_colorize);
|
||||
|
@ -3656,7 +3652,7 @@ static void copy_global_profile (const gchar *profile_name)
|
|||
if (create_persconffile_profile(profile_name, &pf_dir_path) == -1) {
|
||||
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
|
||||
"Can't create directory\n\"%s\":\n%s.",
|
||||
pf_dir_path, strerror(errno));
|
||||
pf_dir_path, g_strerror(errno));
|
||||
|
||||
g_free(pf_dir_path);
|
||||
}
|
||||
|
@ -3665,7 +3661,7 @@ static void copy_global_profile (const gchar *profile_name)
|
|||
&pf_dir_path, &pf_dir_path2) == -1) {
|
||||
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
|
||||
"Can't copy file \"%s\" in directory\n\"%s\" to\n\"%s\":\n%s.",
|
||||
pf_filename, pf_dir_path2, pf_dir_path, strerror(errno));
|
||||
pf_filename, pf_dir_path2, pf_dir_path, g_strerror(errno));
|
||||
|
||||
g_free(pf_filename);
|
||||
g_free(pf_dir_path);
|
||||
|
@ -3718,7 +3714,7 @@ void change_configuration_profile (const gchar *profile_name)
|
|||
if (rf_path != NULL && rf_open_errno != 0) {
|
||||
simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK,
|
||||
"Could not open common recent file\n\"%s\": %s.",
|
||||
rf_path, strerror(rf_open_errno));
|
||||
rf_path, g_strerror(rf_open_errno));
|
||||
}
|
||||
if (recent.gui_fileopen_remembered_dir &&
|
||||
test_for_directory(recent.gui_fileopen_remembered_dir) == EISDIR) {
|
||||
|
|
|
@ -1431,7 +1431,7 @@ prefs_main_write(void)
|
|||
if (create_persconffile_dir(&pf_dir_path) == -1) {
|
||||
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
|
||||
"Can't create directory\n\"%s\"\nfor preferences file: %s.", pf_dir_path,
|
||||
strerror(errno));
|
||||
g_strerror(errno));
|
||||
g_free(pf_dir_path);
|
||||
} else {
|
||||
/* Write the preferencs out. */
|
||||
|
@ -1439,7 +1439,7 @@ prefs_main_write(void)
|
|||
if (err != 0) {
|
||||
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
|
||||
"Can't open preferences file\n\"%s\": %s.", pf_path,
|
||||
strerror(err));
|
||||
g_strerror(err));
|
||||
g_free(pf_path);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1107,7 +1107,7 @@ print_ok_cb(GtkWidget *ok_bt, gpointer parent_w)
|
|||
write_failure_alert_box(args->file, errno);
|
||||
else
|
||||
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
|
||||
"Error writing to print command: %s", strerror(errno));
|
||||
"Error writing to print command: %s", g_strerror(errno));
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -383,7 +383,7 @@ profile_apply(GtkWidget *main_w, GtkTreeView *profile_l, gboolean destroy)
|
|||
if (create_persconffile_profile(profile1->name, &pf_dir_path) == -1) {
|
||||
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
|
||||
"Can't create directory\n\"%s\":\n%s.",
|
||||
pf_dir_path, strerror(errno));
|
||||
pf_dir_path, g_strerror(errno));
|
||||
|
||||
g_free(pf_dir_path);
|
||||
}
|
||||
|
@ -394,7 +394,7 @@ profile_apply(GtkWidget *main_w, GtkTreeView *profile_l, gboolean destroy)
|
|||
&pf_filename, &pf_dir_path, &pf_dir_path2) == -1) {
|
||||
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
|
||||
"Can't copy file \"%s\" in directory\n\"%s\" to\n\"%s\":\n%s.",
|
||||
pf_filename, pf_dir_path2, pf_dir_path, strerror(errno));
|
||||
pf_filename, pf_dir_path2, pf_dir_path, g_strerror(errno));
|
||||
|
||||
g_free(pf_filename);
|
||||
g_free(pf_dir_path);
|
||||
|
@ -420,7 +420,7 @@ profile_apply(GtkWidget *main_w, GtkTreeView *profile_l, gboolean destroy)
|
|||
if (create_persconffile_profile(profile1->name, &pf_dir_path) == -1) {
|
||||
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
|
||||
"Can't create directory\n\"%s\":\n%s.",
|
||||
pf_dir_path, strerror(errno));
|
||||
pf_dir_path, g_strerror(errno));
|
||||
|
||||
g_free(pf_dir_path);
|
||||
}
|
||||
|
@ -436,7 +436,7 @@ profile_apply(GtkWidget *main_w, GtkTreeView *profile_l, gboolean destroy)
|
|||
&pf_dir_path, &pf_dir_path2) == -1) {
|
||||
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
|
||||
"Can't rename directory\n\"%s\" to\n\"%s\":\n%s.",
|
||||
pf_dir_path, pf_dir_path2, strerror(errno));
|
||||
pf_dir_path, pf_dir_path2, g_strerror(errno));
|
||||
|
||||
g_free(pf_dir_path);
|
||||
g_free(pf_dir_path2);
|
||||
|
@ -473,7 +473,7 @@ profile_apply(GtkWidget *main_w, GtkTreeView *profile_l, gboolean destroy)
|
|||
if (delete_persconffile_profile(profile1->name, &pf_dir_path) == -1) {
|
||||
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
|
||||
"Can't delete profile directory\n\"%s\":\n%s.",
|
||||
pf_dir_path, strerror(errno));
|
||||
pf_dir_path, g_strerror(errno));
|
||||
|
||||
g_free(pf_dir_path);
|
||||
}
|
||||
|
@ -1143,7 +1143,7 @@ profile_name_edit_ok (GtkWidget *w _U_, gpointer parent_w)
|
|||
if (create_persconffile_profile(new_name, &pf_dir_path) == -1) {
|
||||
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
|
||||
"Can't create directory\n\"%s\":\n%s.",
|
||||
pf_dir_path, strerror(errno));
|
||||
pf_dir_path, g_strerror(errno));
|
||||
|
||||
g_free(pf_dir_path);
|
||||
} else if (strlen (profile_name) &&
|
||||
|
@ -1152,7 +1152,7 @@ profile_name_edit_ok (GtkWidget *w _U_, gpointer parent_w)
|
|||
{
|
||||
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
|
||||
"Can't copy file \"%s\" in directory\n\"%s\" to\n\"%s\":\n%s.",
|
||||
pf_filename, pf_dir_path2, pf_dir_path, strerror(errno));
|
||||
pf_filename, pf_dir_path2, pf_dir_path, g_strerror(errno));
|
||||
|
||||
g_free(pf_filename);
|
||||
g_free(pf_dir_path);
|
||||
|
@ -1166,7 +1166,7 @@ profile_name_edit_ok (GtkWidget *w _U_, gpointer parent_w)
|
|||
&pf_dir_path, &pf_dir_path2) == -1) {
|
||||
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
|
||||
"Can't rename directory\n\"%s\" to\n\"%s\":\n%s.",
|
||||
pf_dir_path, pf_dir_path2, strerror(errno));
|
||||
pf_dir_path, pf_dir_path2, g_strerror(errno));
|
||||
|
||||
g_free(pf_dir_path);
|
||||
g_free(pf_dir_path2);
|
||||
|
@ -1347,7 +1347,7 @@ profile_delete_cb (GtkWidget *w _U_, gpointer data _U_)
|
|||
if (delete_persconffile_profile(name, &pf_dir_path) == -1) {
|
||||
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
|
||||
"Can't delete profile directory\n\"%s\":\n%s.",
|
||||
pf_dir_path, strerror(errno));
|
||||
pf_dir_path, g_strerror(errno));
|
||||
|
||||
g_free(pf_dir_path);
|
||||
}
|
||||
|
|
|
@ -372,14 +372,14 @@ proto_write(gpointer parent_w _U_)
|
|||
if (create_persconffile_dir(&pf_dir_path) == -1) {
|
||||
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
|
||||
"Can't create directory\n\"%s\"\nfor disabled protocols file: %s.", pf_dir_path,
|
||||
strerror(errno));
|
||||
g_strerror(errno));
|
||||
g_free(pf_dir_path);
|
||||
} else {
|
||||
save_disabled_protos_list(&pf_path, &pf_save_errno);
|
||||
if (pf_path != NULL) {
|
||||
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
|
||||
"C |