Add a safe wrapper for write and fix some warnings
1. Add a function writeall and make swrite wrap that function. Use either writeall or swrite, depending on whether we want to exit on errors or not. 2. Fix warnings when compiling with a higher optimisation level. (CFLAGS ?= -pipe -O3 -march=native -mtune=native -freorder-blocks-and-partition) Signed-off-by: hwangcc <hwangcc@csie.nctu.edu.tw>
This commit is contained in:
@ -164,7 +164,9 @@ static void handle_button_release(xcb_connection_t *conn, xcb_button_release_eve
|
||||
char *link_path;
|
||||
char *exe_path = get_exe_path(argv0);
|
||||
sasprintf(&link_path, "%s.nagbar_cmd", script_path);
|
||||
symlink(exe_path, link_path);
|
||||
if (symlink(exe_path, link_path) == -1) {
|
||||
err(EXIT_FAILURE, "Failed to symlink %s to %s", link_path, exe_path);
|
||||
}
|
||||
|
||||
char *terminal_cmd;
|
||||
sasprintf(&terminal_cmd, "i3-sensible-terminal -e %s", link_path);
|
||||
|
Reference in New Issue
Block a user