removed trash-programs
This commit is contained in:
parent
4cf8171790
commit
bf19c30c3f
|
@ -2,3 +2,4 @@
|
||||||
Own implementation of *nix utils
|
Own implementation of *nix utils
|
||||||
License: wtfpl
|
License: wtfpl
|
||||||
|
|
||||||
|
Author: 8nl
|
||||||
|
|
3
config.h
3
config.h
|
@ -16,9 +16,6 @@
|
||||||
#define MOUNT_LIST "/proc/mounts"
|
#define MOUNT_LIST "/proc/mounts"
|
||||||
#define MOUNT_OPT_SIZE 512
|
#define MOUNT_OPT_SIZE 512
|
||||||
|
|
||||||
/* nologin sleep */
|
|
||||||
#define NOLOGIN_SLEEP 0
|
|
||||||
|
|
||||||
/* colors for ls */
|
/* colors for ls */
|
||||||
#define LS_DIR_COLOR "\033[1;34m"
|
#define LS_DIR_COLOR "\033[1;34m"
|
||||||
#define LS_LINK_COLOR "\033[1;35m"
|
#define LS_LINK_COLOR "\033[1;35m"
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
project_dir=$(pwd)
|
|
||||||
echo ./*.c $CFLAGS -o $OUTPUT$(basename $project_dir) | xargs $CC
|
|
|
@ -1,16 +0,0 @@
|
||||||
#include <stdio.h>
|
|
||||||
#include <errno.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
|
|
||||||
int main(void) {
|
|
||||||
char *p = getlogin();
|
|
||||||
if (p != NULL) {
|
|
||||||
puts(p);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
fprintf(stderr, "logname: %s\n", strerror(errno));
|
|
||||||
return 1;
|
|
||||||
}
|
|
|
@ -1,3 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
project_dir=$(pwd)
|
|
||||||
echo ./*.c $CFLAGS -o $OUTPUT$(basename $project_dir) | xargs $CC
|
|
|
@ -1,52 +0,0 @@
|
||||||
#include <stdio.h>
|
|
||||||
#include <errno.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <sys/stat.h>
|
|
||||||
|
|
||||||
long parse_long(const char *str) {
|
|
||||||
char *ptr = NULL;
|
|
||||||
long value = strtol(str, &ptr, 10);
|
|
||||||
|
|
||||||
if (*ptr) {
|
|
||||||
fprintf(stderr, "mkfifo: not a number: %s\n", str);
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
else if (value < 1) {
|
|
||||||
fprintf(stderr, "mknod: number is negative: %s\n", str);
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
|
|
||||||
int main(int argc, char **argv) {
|
|
||||||
mode_t mode = 0666;
|
|
||||||
|
|
||||||
int opt;
|
|
||||||
while ((opt = getopt(argc, argv, "m:")) != -1) {
|
|
||||||
switch (opt) {
|
|
||||||
case 'm':
|
|
||||||
mode = parse_long(optarg);
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
printf("mkfifo [m] [file1 file2...]\n\t-m MODE\n");
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
argv += optind;
|
|
||||||
argc -= optind;
|
|
||||||
|
|
||||||
for (int i = 0; i < argc; i++) {
|
|
||||||
if (mkfifo(argv[i], mode)) {
|
|
||||||
fprintf(stderr, "mkfifo: %s %s\n", argv[i], strerror(errno));
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
|
@ -1,3 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
project_dir=$(pwd)
|
|
||||||
echo ./*.c $CFLAGS -o $OUTPUT$(basename $project_dir) | xargs $CC
|
|
|
@ -1,9 +0,0 @@
|
||||||
#include <stdio.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
#include "config.h"
|
|
||||||
|
|
||||||
int main(void) {
|
|
||||||
printf("nologin: shell disabled\n");
|
|
||||||
sleep(NOLOGIN_SLEEP);
|
|
||||||
return 0;
|
|
||||||
}
|
|
|
@ -58,7 +58,7 @@ int main(int argc, char **argv) {
|
||||||
}
|
}
|
||||||
|
|
||||||
else {
|
else {
|
||||||
printf("spark [num1 num2...]\n\t[-n Use \\r] [-r Reverse]\n");
|
printf("spark [rn] [num1 num2...]\n\t-n Use \\r\n\t-r Reverse]\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue