]> glassweightruler.freedombox.rocks Git - Ventoy.git/blob - BUSYBOX/chmod/vtchmod.c
Auto use memdisk mode for KolibriOS.iso
[Ventoy.git] / BUSYBOX / chmod / vtchmod.c
1 #include <stdio.h>
2 #include <string.h>
3 #include <sys/types.h>
4 #include <sys/stat.h>
5 #include <sys/utsname.h>
6
7 int main(int argc, char **argv)
8 {
9 if (argc != 2)
10 {
11 return 1;
12 }
13
14 if (argv[1][0] == '-' && argv[1][1] == '6')
15 {
16 struct utsname buf;
17 if (0 == uname(&buf))
18 {
19 if (strstr(buf.machine, "amd64"))
20 {
21 return 0;
22 }
23
24 if (strstr(buf.machine, "x86_64"))
25 {
26 return 0;
27 }
28 }
29 return 1;
30 }
31
32 return chmod(argv[1], 0777);
33 }
34