Skip to content

Commit

Permalink
cleanup: fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
msantos committed Nov 24, 2021
1 parent a78f60d commit a33e57f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
2 changes: 2 additions & 0 deletions fnv1a.c
@@ -1,6 +1,8 @@
#include <stdint.h>
#include <stdlib.h>

#include "fnv1a.h"

static const uint32_t fnv1a32_prime = 16777619;
static const uint32_t fnv1a32_offset = 2166136261U;

Expand Down
4 changes: 3 additions & 1 deletion limit_process.c
@@ -1,4 +1,4 @@
/* Copyright (c) 2019, Michael Santos <michael.santos@gmail.com>
/* Copyright (c) 2019-2021, Michael Santos <michael.santos@gmail.com>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
Expand All @@ -16,6 +16,8 @@
#include <sys/resource.h>
#include <time.h>

#include "limit_process.h"

int limit_process(runcron_t *rp) {
struct rlimit rl = {0};

Expand Down
13 changes: 7 additions & 6 deletions runcron.c
Expand Up @@ -22,6 +22,7 @@
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdnoreturn.h>
#include <string.h>
#include <sys/file.h>
#include <sys/param.h>
Expand Down Expand Up @@ -65,7 +66,7 @@ static int set_env(char *key, int val);
static void print_argv(int argc, char *argv[]);
static int randinit(char *tag);
static char *join(char **arg, size_t n);
static void usage(void);
static noreturn void usage(void);

static const struct option long_options[] = {
{"file", required_argument, NULL, 'f'},
Expand All @@ -88,11 +89,11 @@ static const struct option long_options[] = {
{NULL, 0, NULL, 0},
};

pid_t pid;
static pid_t pid;
static int fdp = -1;
int default_signal = SIGTERM;
volatile sig_atomic_t runnow = 0;
volatile sig_atomic_t remaining = 0;
static int default_signal = SIGTERM;
static volatile sig_atomic_t runnow = 0;
static volatile sig_atomic_t remaining = 0;

int main(int argc, char *argv[]) {
runcron_t *rp;
Expand Down Expand Up @@ -606,7 +607,7 @@ static char *join(char **arg, size_t n) {
return NULL;
}

static void usage() {
static noreturn void usage() {
errx(EXIT_FAILURE,
"[OPTION] <CRONTAB EXPRESSION> <command> <arg> <...>\n"
"version: %s (using %s mode process restriction)\n\n"
Expand Down
2 changes: 2 additions & 0 deletions strtonum.c
Expand Up @@ -24,6 +24,8 @@
#include <limits.h>
#include <stdlib.h>

#include "strtonum.h"

#define INVALID 1
#define TOOSMALL 2
#define TOOLARGE 3
Expand Down

0 comments on commit a33e57f

Please sign in to comment.