File: utime.c

package info (click to toggle)
tinydyndns 0.4.2.debian1-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,432 kB
  • sloc: ansic: 10,256; sh: 291; makefile: 42
file content (25 lines) | stat: -rw-r--r-- 369 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include <sys/types.h>
#include <sys/time.h>
#include <utime.h>
#include "scan.h"
#include "exit.h"

char *fn;

char *ustr;
unsigned long u;
time_t ut[2];

int main(int argc,char **argv)
{
  fn = argv[1];
  if (!fn) _exit(100);

  ustr = argv[2];
  if (!ustr) _exit(100);
  scan_ulong(ustr,&u);

  ut[0] = ut[1] = u;
  if (utime(fn,ut) == -1) _exit(111);
  _exit(0);
}