Remove some dead code

This commit is contained in:
Justine Tunney 2023-07-03 02:47:05 -07:00
parent 168d1c157e
commit 73c0faa1b5
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
66 changed files with 324 additions and 7705 deletions

View file

@ -17,31 +17,31 @@
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/calls/calls.h"
#include "libc/errno.h"
#include "libc/fmt/magnumstrs.internal.h"
#include "libc/runtime/runtime.h"
#include "libc/stdio/stdio.h"
#include "libc/str/str.h"
/**
* @fileoverview Command for updating timestamps on files.
* @fileoverview file timestamp update command
*/
int main(int argc, char *argv[]) {
int i;
const char *s, *prog;
prog = argc > 0 ? argv[0] : "touch.com";
const char *prog;
prog = argv[0];
if (!prog) prog = "touch";
if (argc < 2) {
tinyprint(2, prog, ": missing operand\n", NULL);
exit(1);
}
for (i = 1; i < argc; ++i) {
if (touch(argv[i], 0666) == -1) {
s = _strerdoc(errno);
fputs(prog, stderr);
fputs(": cannot touch '", stderr);
fputs(argv[i], stderr);
fputs("': ", stderr);
fputs(s, stderr);
fputs("\n", stderr);
perror(argv[i]);
exit(1);
}
}
return 0;
}