static INT64_T do_xattr_set(int argc, char **argv) { char full_path[CHIRP_PATH_MAX]; complete_remote_path(argv[1], full_path); INT64_T size; if(argc == 3) { if((size = chirp_reli_removexattr(current_host, full_path, argv[2], stoptime)) >= 0) { return 0; } else { return -1; } } else { if((size = chirp_reli_setxattr(current_host, full_path, argv[2], argv[3], strlen(argv[3]), 0, stoptime)) >= 0) { return 0; } else { return -1; } } }
INT64_T chirp_global_removexattr(const char *host, const char *path, const char *name, time_t stoptime) { if(is_multi_path(host)) { errno = EACCES; return -1; } else if(not_empty(path)) { return chirp_reli_removexattr(host, path, name, stoptime); } else if(not_empty(host)) { if(server_lookup(host, stoptime)) { errno = EACCES; return -1; } else { errno = ENOENT; return -1; } } else { errno = EACCES; return -1; } }