62 |
{ |
{ |
63 |
#define param (*(struct param_t*)vparam) |
#define param (*(struct param_t*)vparam) |
64 |
#define opt option_mask32 |
#define opt option_mask32 |
65 |
uid_t u = (param.ugid.uid == (uid_t)-1) ? statbuf->st_uid : param.ugid.uid; |
uid_t u = (param.ugid.uid == (uid_t)-1L) ? statbuf->st_uid : param.ugid.uid; |
66 |
gid_t g = (param.ugid.gid == (gid_t)-1) ? statbuf->st_gid : param.ugid.gid; |
gid_t g = (param.ugid.gid == (gid_t)-1L) ? statbuf->st_gid : param.ugid.gid; |
67 |
|
|
68 |
if (param.chown_func(fileName, u, g) == 0) { |
if (param.chown_func(fileName, u, g) == 0) { |
69 |
if (OPT_VERBOSE |
if (OPT_VERBOSE |
75 |
return TRUE; |
return TRUE; |
76 |
} |
} |
77 |
if (!OPT_QUIET) |
if (!OPT_QUIET) |
78 |
bb_simple_perror_msg(fileName); /* A filename can have % in it... */ |
bb_simple_perror_msg(fileName); |
79 |
return FALSE; |
return FALSE; |
80 |
#undef opt |
#undef opt |
81 |
#undef param |
#undef param |
87 |
int opt, flags; |
int opt, flags; |
88 |
struct param_t param; |
struct param_t param; |
89 |
|
|
90 |
param.ugid.uid = -1; |
/* Just -1 might not work: uid_t may be unsigned long */ |
91 |
param.ugid.gid = -1; |
param.ugid.uid = -1L; |
92 |
|
param.ugid.gid = -1L; |
93 |
|
|
94 |
#if ENABLE_FEATURE_CHOWN_LONG_OPTIONS |
#if ENABLE_FEATURE_CHOWN_LONG_OPTIONS |
95 |
applet_long_options = chown_longopts; |
applet_long_options = chown_longopts; |