diff options
-rw-r--r-- | include/stringop.h | 5 | ||||
-rw-r--r-- | sway/commands.c | 1 | ||||
-rw-r--r-- | sway/container.c | 2 | ||||
-rw-r--r-- | sway/log.c | 4 | ||||
-rw-r--r-- | sway/main.c | 1 | ||||
-rw-r--r-- | sway/stringop.c | 8 | ||||
-rw-r--r-- | sway/workspace.c | 1 |
7 files changed, 19 insertions, 3 deletions
diff --git a/include/stringop.h b/include/stringop.h index dde50f13..f9f3130c 100644 --- a/include/stringop.h +++ b/include/stringop.h | |||
@@ -2,6 +2,11 @@ | |||
2 | #define _SWAY_STRINGOP_H | 2 | #define _SWAY_STRINGOP_H |
3 | #include "list.h" | 3 | #include "list.h" |
4 | 4 | ||
5 | #if !HAVE_DECL_SETENV | ||
6 | // Not sure why we need to provide this | ||
7 | extern int setenv(const char *, const char *, int); | ||
8 | #endif | ||
9 | |||
5 | // array of whitespace characters to use for delims | 10 | // array of whitespace characters to use for delims |
6 | extern const char *whitespace; | 11 | extern const char *whitespace; |
7 | 12 | ||
diff --git a/sway/commands.c b/sway/commands.c index 71eb9d70..68bdff2c 100644 --- a/sway/commands.c +++ b/sway/commands.c | |||
@@ -5,6 +5,7 @@ | |||
5 | #include <stdlib.h> | 5 | #include <stdlib.h> |
6 | #include <errno.h> | 6 | #include <errno.h> |
7 | #include <string.h> | 7 | #include <string.h> |
8 | #include <strings.h> | ||
8 | #include <unistd.h> | 9 | #include <unistd.h> |
9 | #include <ctype.h> | 10 | #include <ctype.h> |
10 | #include <sys/types.h> | 11 | #include <sys/types.h> |
diff --git a/sway/container.c b/sway/container.c index ef0e6c55..85b169a1 100644 --- a/sway/container.c +++ b/sway/container.c | |||
@@ -1,7 +1,9 @@ | |||
1 | #include <stdlib.h> | 1 | #include <stdlib.h> |
2 | #include <stdbool.h> | 2 | #include <stdbool.h> |
3 | #include <strings.h> | 3 | #include <strings.h> |
4 | #include <string.h> | ||
4 | #include "config.h" | 5 | #include "config.h" |
6 | #include "stringop.h" | ||
5 | #include "container.h" | 7 | #include "container.h" |
6 | #include "workspace.h" | 8 | #include "workspace.h" |
7 | #include "focus.h" | 9 | #include "focus.h" |
@@ -80,9 +80,7 @@ void sway_log_errno(log_importance_t verbosity, char* format, ...) { | |||
80 | va_end(args); | 80 | va_end(args); |
81 | 81 | ||
82 | fprintf(stderr, ": "); | 82 | fprintf(stderr, ": "); |
83 | char error[256]; | 83 | fprintf(stderr, "%s", strerror(errno)); |
84 | strerror_r(errno, error, sizeof(error)); | ||
85 | fprintf(stderr, "%s", error); | ||
86 | 84 | ||
87 | if (colored && isatty(STDERR_FILENO)) { | 85 | if (colored && isatty(STDERR_FILENO)) { |
88 | fprintf(stderr, "\x1B[0m"); | 86 | fprintf(stderr, "\x1B[0m"); |
diff --git a/sway/main.c b/sway/main.c index 97243f99..66921184 100644 --- a/sway/main.c +++ b/sway/main.c | |||
@@ -7,6 +7,7 @@ | |||
7 | #include <signal.h> | 7 | #include <signal.h> |
8 | #include <getopt.h> | 8 | #include <getopt.h> |
9 | #include "layout.h" | 9 | #include "layout.h" |
10 | #include "stringop.h" | ||
10 | #include "config.h" | 11 | #include "config.h" |
11 | #include "log.h" | 12 | #include "log.h" |
12 | #include "readline.h" | 13 | #include "readline.h" |
diff --git a/sway/stringop.c b/sway/stringop.c index 191e40c8..7a2c8317 100644 --- a/sway/stringop.c +++ b/sway/stringop.c | |||
@@ -311,3 +311,11 @@ char *join_list(list_t *list, char *separator) { | |||
311 | 311 | ||
312 | return res; | 312 | return res; |
313 | } | 313 | } |
314 | |||
315 | char *strdup(const char *str) { | ||
316 | char *dup = malloc(strlen(str) + 1); | ||
317 | if (dup) { | ||
318 | strcpy(dup, str); | ||
319 | } | ||
320 | return dup; | ||
321 | } | ||
diff --git a/sway/workspace.c b/sway/workspace.c index 658f79bc..c169c1cb 100644 --- a/sway/workspace.c +++ b/sway/workspace.c | |||
@@ -2,6 +2,7 @@ | |||
2 | #include <stdbool.h> | 2 | #include <stdbool.h> |
3 | #include <wlc/wlc.h> | 3 | #include <wlc/wlc.h> |
4 | #include <string.h> | 4 | #include <string.h> |
5 | #include <strings.h> | ||
5 | #include "workspace.h" | 6 | #include "workspace.h" |
6 | #include "layout.h" | 7 | #include "layout.h" |
7 | #include "list.h" | 8 | #include "list.h" |