Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Android.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE := daemonize
LOCAL_SRC_FILES := getopt.c daemonize.c

include $(BUILD_EXECUTABLE)
1 change: 1 addition & 0 deletions Application.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
APP_STL := none
14 changes: 14 additions & 0 deletions android-config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#include <stdio.h>
#include <unistd.h>
#include <errno.h>
#include <stdbool.h>
#include <libgen.h>

#define FALSE false
#define TRUE true

extern int x_getopt (int argc, char **argv, const char *opts);
extern int x_opterr;
extern int x_optind;
extern int x_optopt;
extern char *x_optarg;
13 changes: 8 additions & 5 deletions daemonize.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/file.h>
#ifndef ANDROID
#include "config.h"
#else
#include "android-config.h"
#endif
#include "version.h"

/*---------------------------------------------------------------------------*\
Expand Down Expand Up @@ -95,7 +99,7 @@ static void verbose(const char *format, ...)
*/
static void usage(char *prog)
{
static const char *USAGE[] =
static const char *USAGE[] =
{
"Usage: %s [OPTIONS] path [arg] ...",
"",
Expand Down Expand Up @@ -360,12 +364,12 @@ static void open_output_files()
{
if ((out_fd = open_output_file(out_file)) == -1)
{
die("Can't open \"%s\" for stdout: %s\n",
die("Can't open \"%s\" for stdout: %s\n",
out_file, strerror(errno));
}
}

else
else
{
out_fd = null_fd;
}
Expand All @@ -377,7 +381,7 @@ static void open_output_files()

else if ((err_fd = open_output_file(err_file)) == -1)
{
die("Can't open \"%s\" for stderr: %s\n",
die("Can't open \"%s\" for stderr: %s\n",
err_file, strerror (errno));
}
}
Expand Down Expand Up @@ -530,4 +534,3 @@ int main(int argc, char **argv)
}

/* vim: set et sw=4 sts=4 : */

1 change: 1 addition & 0 deletions jni