aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/client.h4
-rw-r--r--src/common.h3
-rw-r--r--src/daemon.h5
-rw-r--r--src/daemonise.c1
-rw-r--r--src/daemonise.h1
-rw-r--r--src/parse_time.c1
-rw-r--r--src/parse_time.h3
-rw-r--r--src/sat.c3
-rw-r--r--src/satd-diminished.c3
-rw-r--r--src/satd.c7
10 files changed, 21 insertions, 10 deletions
diff --git a/src/client.h b/src/client.h
index 900f6ec..b3ade56 100644
--- a/src/client.h
+++ b/src/client.h
@@ -19,6 +19,9 @@
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
+#ifndef _DEFAULT_SOURCE
+# define _DEFAULT_SOURCE
+#endif
#include <stddef.h>
@@ -63,7 +66,6 @@ enum command {
*/
int send_command(enum command cmd, size_t n, const char *restrict msg);
-
/**
* Return the number of bytes required to store a string array.
*
diff --git a/src/common.h b/src/common.h
index 36f66af..db642c2 100644
--- a/src/common.h
+++ b/src/common.h
@@ -19,6 +19,9 @@
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
+#ifndef _DEFAULT_SOURCE
+# define _DEFAULT_SOURCE
+#endif
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/src/daemon.h b/src/daemon.h
index bd4a7af..f6ebaf0 100644
--- a/src/daemon.h
+++ b/src/daemon.h
@@ -19,6 +19,9 @@
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
+#ifndef _DEFAULT_SOURCE
+# define _DEFAULT_SOURCE
+#endif
#include <stddef.h>
#include <errno.h>
#include <string.h>
@@ -108,7 +111,7 @@ struct job {
/**
* “argv” followed by “envp”.
*/
- char payload[0];
+ char payload[];
};
diff --git a/src/daemonise.c b/src/daemonise.c
index 3f2e858..8b90dd0 100644
--- a/src/daemonise.c
+++ b/src/daemonise.c
@@ -21,6 +21,7 @@
*
* This file is copied from <http://github.com/maandree/slibc>.
*/
+#define _POSIX_C_SOURCE 200809L
#include "daemonise.h"
#include <unistd.h>
#include <fcntl.h>
diff --git a/src/daemonise.h b/src/daemonise.h
index a43e61a..e9d00d1 100644
--- a/src/daemonise.h
+++ b/src/daemonise.h
@@ -21,6 +21,7 @@
*/
+
/**
* Leave all opened files open.
*/
diff --git a/src/parse_time.c b/src/parse_time.c
index d461efd..828c31b 100644
--- a/src/parse_time.c
+++ b/src/parse_time.c
@@ -19,6 +19,7 @@
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
+#define _DEFAULT_SOURCE
#include "parse_time.h"
#include <stdio.h>
#include <stdlib.h>
diff --git a/src/parse_time.h b/src/parse_time.h
index 8e74607..efe5ad5 100644
--- a/src/parse_time.h
+++ b/src/parse_time.h
@@ -19,6 +19,9 @@
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
+#if !defined(_POSIX_C_SOURCE) || (_POSIX_C_SOURCE < 199309L)
+# define _POSIX_C_SOURCE 199309L
+#endif
#include <time.h>
diff --git a/src/sat.c b/src/sat.c
index 6766542..b86ae39 100644
--- a/src/sat.c
+++ b/src/sat.c
@@ -19,11 +19,10 @@
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
-#include <errno.h>
-
#include "parse_time.h"
#include "client.h"
#include "common.h"
+#include <errno.h>
diff --git a/src/satd-diminished.c b/src/satd-diminished.c
index 606d8ec..a46b67d 100644
--- a/src/satd-diminished.c
+++ b/src/satd-diminished.c
@@ -19,6 +19,7 @@
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
+#include "daemon.h"
#include <unistd.h>
#include <errno.h>
#include <stdio.h>
@@ -27,8 +28,6 @@
#include <sys/wait.h>
#include <sys/stat.h>
-#include "daemon.h"
-
/**
diff --git a/src/satd.c b/src/satd.c
index 6daf7cf..fbb1e48 100644
--- a/src/satd.c
+++ b/src/satd.c
@@ -19,6 +19,9 @@
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
+#include "common.h"
+#include "daemon.h"
+#include "daemonise.h"
#include <unistd.h>
#include <errno.h>
#include <pwd.h>
@@ -27,10 +30,6 @@
#include <sys/un.h>
#include <sys/file.h>
-#include "daemonise.h"
-#include "common.h"
-#include "daemon.h"
-
/**