1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-26 08:22:37 +01:00

Remove wsyserrorwithcode, rename wsyserror to werror

wsyserrorwithcode - Not used, no point either.
wsyserror->werror - qualifying "error" with a "type" hardly makes
sense if there are not at least two "type"s. There are not. Safe trip.

Signed-off-by: Tamas TEVESZ <ice@extreme.hu>
This commit is contained in:
Tamas TEVESZ
2010-09-27 16:12:57 +02:00
committed by Carlos R. Mafra
parent c5f5e0b9c0
commit 1f21919809
20 changed files with 92 additions and 108 deletions

View File

@@ -2667,7 +2667,7 @@ static int setWorkspaceSpecificBack(WScreen * scr, WDefaultEntry * entry, WMProp
return 0;
if (pipe(filedes) < 0) {
wsyserror("pipe() failed:can't set workspace specific background image");
werror("pipe() failed:can't set workspace specific background image");
WMReleasePropList(value);
return 0;
@@ -2675,11 +2675,11 @@ static int setWorkspaceSpecificBack(WScreen * scr, WDefaultEntry * entry, WMProp
pid = fork();
if (pid < 0) {
wsyserror("fork() failed:can't set workspace specific background image");
werror("fork() failed:can't set workspace specific background image");
if (close(filedes[0]) < 0)
wsyserror("could not close pipe");
werror("could not close pipe");
if (close(filedes[1]) < 0)
wsyserror("could not close pipe");
werror("could not close pipe");
} else if (pid == 0) {
char *dither;
@@ -2687,24 +2687,24 @@ static int setWorkspaceSpecificBack(WScreen * scr, WDefaultEntry * entry, WMProp
SetupEnvironment(scr);
if (close(0) < 0)
wsyserror("could not close pipe");
werror("could not close pipe");
if (dup(filedes[0]) < 0) {
wsyserror("dup() failed:can't set workspace specific background image");
werror("dup() failed:can't set workspace specific background image");
}
dither = wPreferences.no_dithering ? "-m" : "-d";
if (wPreferences.smooth_workspace_back)
execlp("wmsetbg", "wmsetbg", "-helper", "-S", dither, NULL);
else
execlp("wmsetbg", "wmsetbg", "-helper", dither, NULL);
wsyserror("could not execute wmsetbg");
werror("could not execute wmsetbg");
exit(1);
} else {
if (fcntl(filedes[0], F_SETFD, FD_CLOEXEC) < 0) {
wsyserror("error setting close-on-exec flag");
werror("error setting close-on-exec flag");
}
if (fcntl(filedes[1], F_SETFD, FD_CLOEXEC) < 0) {
wsyserror("error setting close-on-exec flag");
werror("error setting close-on-exec flag");
}
scr->helper_fd = filedes[1];

View File

@@ -1551,7 +1551,7 @@ int wShowCrashingDialogPanel(int whatSig)
scr = WMCreateScreen(dpy, screen_no);
if (!scr) {
wsyserror(_("cannot open connection for crashing dialog panel. Aborting."));
werror(_("cannot open connection for crashing dialog panel. Aborting."));
return WMAbort;
}

View File

@@ -448,7 +448,7 @@ static char *getnameforicon(WWindow * wwin)
if (access(path, F_OK) != 0) {
if (mkdir(path, S_IRUSR | S_IWUSR | S_IXUSR)) {
wsyserror(_("could not create directory %s"), path);
werror(_("could not create directory %s"), path);
wfree(path);
wfree(suffix);
return NULL;
@@ -457,7 +457,7 @@ static char *getnameforicon(WWindow * wwin)
strcat(path, "/CachedPixmaps");
if (access(path, F_OK) != 0) {
if (mkdir(path, S_IRUSR | S_IWUSR | S_IXUSR) != 0) {
wsyserror(_("could not create directory %s"), path);
werror(_("could not create directory %s"), path);
wfree(path);
wfree(suffix);
return NULL;

View File

@@ -309,7 +309,7 @@ void Restart(char *manager, Bool abortOnFailure)
wfatal(_("failed to restart Window Maker."));
} else {
execvp(prog, argv);
wsyserror(_("could not exec %s"), prog);
werror(_("could not exec %s"), prog);
}
if (abortOnFailure)
exit(7);
@@ -388,10 +388,10 @@ void ExecuteShellCommand(WScreen * scr, char *command)
setsid();
#endif
execl(shell, shell, "-c", command, NULL);
wsyserror("could not execute %s -c %s", shell, command);
werror("could not execute %s -c %s", shell, command);
Exit(-1);
} else if (pid < 0) {
wsyserror("cannot fork a new process");
werror("cannot fork a new process");
} else {
_tuple *data = wmalloc(sizeof(_tuple));
@@ -517,7 +517,7 @@ static void execInitScript()
if (file) {
if (system(file) != 0) {
wsyserror(_("%s:could not execute initialization script"), file);
werror(_("%s:could not execute initialization script"), file);
}
wfree(file);
}
@@ -535,7 +535,7 @@ void ExecExitScript()
if (file) {
if (system(file) != 0) {
wsyserror(_("%s:could not execute exit script"), file);
werror(_("%s:could not execute exit script"), file);
}
wfree(file);
}
@@ -754,7 +754,7 @@ static int real_main(int argc, char **argv)
}
if (fcntl(ConnectionNumber(dpy), F_SETFD, FD_CLOEXEC) < 0) {
wsyserror("error setting close-on-exec flag for X connection");
werror("error setting close-on-exec flag for X connection");
exit(1);
}

View File

@@ -79,7 +79,7 @@ static char *username(void)
user = getpwuid(getuid());
if (!user) {
wsyserror(_("could not get password entry for UID %i"), getuid());
werror(_("could not get password entry for UID %i"), getuid());
return NULL;
}
if (!user->pw_name) {
@@ -1013,7 +1013,7 @@ void SendHelperMessage(WScreen * scr, char type, int workspace, char *msg)
strcpy(&buffer[i], msg);
if (write(scr->helper_fd, buffer, len + 4) < 0) {
wsyserror(_("could not send message to background image helper"));
werror(_("could not send message to background image helper"));
}
wfree(buffer);
}

View File

@@ -56,7 +56,7 @@ int showCrashDialog(int sig)
XCloseDisplay(dpy);
dpy = NULL;
} else {
wsyserror(_("cannot open connection for crashing dialog panel. Aborting."));
werror(_("cannot open connection for crashing dialog panel. Aborting."));
crashAction = WMAbort;
}
@@ -98,16 +98,16 @@ int MonitorLoop(int argc, char **argv)
pid = fork();
if (pid == 0) {
execvp(child_argv[0], child_argv);
wsyserror(_("Error respawning Window Maker"));
werror(_("Error respawning Window Maker"));
exit(1);
} else if (pid < 0) {
wsyserror(_("Error respawning Window Maker"));
werror(_("Error respawning Window Maker"));
exit(1);
}
do {
if ((exited = waitpid(-1, &status, 0)) < 0) {
wsyserror(_("Error during monitoring of Window Maker process."));
werror(_("Error during monitoring of Window Maker process."));
error = True;
break;
}

View File

@@ -636,7 +636,7 @@ static void constructMenu(WMenu * menu, WMenuEntry * entry)
if (first < 0)
first = i;
} else {
wsyserror(_("%s:could not stat menu"), path[i]);
werror(_("%s:could not stat menu"), path[i]);
/*goto finish; */
}
@@ -644,7 +644,7 @@ static void constructMenu(WMenu * menu, WMenuEntry * entry)
}
if (first < 0) {
wsyserror(_("%s:could not stat menu:%s"), "OPEN_MENU", (char *)entry->clientdata);
werror(_("%s:could not stat menu:%s"), "OPEN_MENU", (char *)entry->clientdata);
goto finish;
}
stat(path[first], &stat_buf);
@@ -1082,7 +1082,7 @@ static WMenu *readMenuFile(WScreen * scr, char *file_name)
wfree(args);
file = popen(command, "r");
if (!file) {
wsyserror(_("%s:could not open/preprocess menu file"), file_name);
werror(_("%s:could not open/preprocess menu file"), file_name);
} else {
cpp = 1;
}
@@ -1093,7 +1093,7 @@ static WMenu *readMenuFile(WScreen * scr, char *file_name)
if (!file) {
file = fopen(file_name, "rb");
if (!file) {
wsyserror(_("%s:could not open menu file"), file_name);
werror(_("%s:could not open menu file"), file_name);
return NULL;
}
}
@@ -1127,7 +1127,7 @@ static WMenu *readMenuFile(WScreen * scr, char *file_name)
#ifdef CPP
if (cpp) {
if (pclose(file) == -1) {
wsyserror(_("error reading preprocessed menu data"));
werror(_("error reading preprocessed menu data"));
}
} else {
fclose(file);
@@ -1178,7 +1178,7 @@ static WMenu *readMenuPipe(WScreen * scr, char **file_name)
wfree(args);
file = popen(command, "r");
if (!file) {
wsyserror(_("%s:could not open/preprocess menu file"), filename);
werror(_("%s:could not open/preprocess menu file"), filename);
} else {
cpp = 1;
}
@@ -1190,7 +1190,7 @@ static WMenu *readMenuPipe(WScreen * scr, char **file_name)
file = popen(filename, "rb");
if (!file) {
wsyserror(_("%s:could not open menu file"), filename);
werror(_("%s:could not open menu file"), filename);
return NULL;
}
}
@@ -1297,7 +1297,7 @@ static WMenu *readMenuDirectory(WScreen * scr, char *title, char **path, char *c
buffer = malloc(strlen(path[i]) + strlen(dentry->d_name) + 4);
if (!buffer) {
wsyserror(_("out of memory while constructing directory menu %s"), path[i]);
werror(_("out of memory while constructing directory menu %s"), path[i]);
break;
}
@@ -1306,7 +1306,7 @@ static WMenu *readMenuDirectory(WScreen * scr, char *title, char **path, char *c
strcat(buffer, dentry->d_name);
if (stat(buffer, &stat_buf) != 0) {
wsyserror(_("%s:could not stat file \"%s\" in menu directory"),
werror(_("%s:could not stat file \"%s\" in menu directory"),
path[i], dentry->d_name);
} else {
Bool isFilePack = False;
@@ -1369,7 +1369,7 @@ static WMenu *readMenuDirectory(WScreen * scr, char *title, char **path, char *c
length += strlen(command) + 6;
buffer = malloc(length);
if (!buffer) {
wsyserror(_("out of memory while constructing directory menu %s"), path[data->index]);
werror(_("out of memory while constructing directory menu %s"), path[data->index]);
break;
}
@@ -1408,7 +1408,7 @@ static WMenu *readMenuDirectory(WScreen * scr, char *title, char **path, char *c
buffer = malloc(length);
if (!buffer) {
wsyserror(_("out of memory while constructing directory menu %s"), path[data->index]);
werror(_("out of memory while constructing directory menu %s"), path[data->index]);
break;
}
@@ -1501,13 +1501,13 @@ static WMenu *configureMenu(WScreen * scr, WMPropList * definition)
}
if (!path) {
wsyserror(_("could not find menu file \"%s\" referenced in WMRootMenu"), tmp);
werror(_("could not find menu file \"%s\" referenced in WMRootMenu"), tmp);
wfree(tmp);
return NULL;
}
if (stat(path, &stat_buf) < 0) {
wsyserror(_("could not access menu \"%s\" referenced in WMRootMenu"), path);
werror(_("could not access menu \"%s\" referenced in WMRootMenu"), path);
wfree(path);
wfree(tmp);
return NULL;

View File

@@ -1010,7 +1010,7 @@ void wScreenSaveState(WScreen * scr)
str = wdefaultspathfordomain(buf);
}
if (!WMWritePropListToFile(scr->session_state, str)) {
wsyserror(_("could not save session state in %s"), str);
werror(_("could not save session state in %s"), str);
}
wfree(str);
WMReleasePropList(old_state);