Update chown.c

This commit is contained in:
Brendan Malone
2022-06-30 13:39:29 -05:00
committed by GitHub
parent 875845f669
commit 9307edbf71
+1 -8
View File
@@ -1,21 +1,14 @@
//
// main.c
// T1222.002own
//
// Created by bam on 6/27/22.
//
#include <errno.h>
#include <unistd.h>
#include <stdio.h>
int main(int argc, const char * argv[]) {
// insert code here...
if (argc < 2) {
printf("usage: %s </path/to/file>\n", argv[0]);
return 2;
}
//change user and group to root
const char *filepath = argv[1];
int rv = chown(filepath, 0, 0);
if (0 != rv) {