HEX
Server: Apache
System: Linux s198.coreserver.jp 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC 2025 x86_64
User: nagasaki (10062)
PHP: 7.1.33
Disabled: NONE
Upload Files
File: //package/admin/daemontools/compile/svok.c
#include <unistd.h>
#include "strerr.h"
#include "error.h"
#include "open.h"

#define FATAL "svok: fatal: "

int main(int argc,char **argv)
{
  int fd;

  if (!argv[1])
    strerr_die1x(100,"svok: usage: svok dir");

  if (chdir(argv[1]) == -1)
    strerr_die4sys(111,FATAL,"unable to chdir to ",argv[1],": ");

  fd = open_write("supervise/ok");
  if (fd == -1) {
    if (errno == error_noent) _exit(100);
    if (errno == error_nodevice) _exit(100);
    strerr_die4sys(111,FATAL,"unable to open ",argv[1],"/supervise/ok: ");
  }

  _exit(0);
}