Changes in uspace/app/sysinst/futil.c [39330200:8e3498b] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/sysinst/futil.c
r39330200 r8e3498b 54 54 * @return EOK on success, EIO on I/O error 55 55 */ 56 errno_t futil_copy_file(const char *srcp, const char *destp)56 int futil_copy_file(const char *srcp, const char *destp) 57 57 { 58 58 int sf, df; 59 59 size_t nr, nw; 60 errno_t rc;60 int rc; 61 61 aoff64_t posr = 0, posw = 0; 62 62 63 63 printf("Copy '%s' to '%s'.\n", srcp, destp); 64 64 65 rc = vfs_lookup_open(srcp, WALK_REGULAR, MODE_READ, &sf);66 if ( rc != EOK)67 return EIO; 68 69 rc = vfs_lookup_open(destp, WALK_REGULAR | WALK_MAY_CREATE, MODE_WRITE, &df);70 if ( rc != EOK)65 sf = vfs_lookup_open(srcp, WALK_REGULAR, MODE_READ); 66 if (sf < 0) 67 return EIO; 68 69 df = vfs_lookup_open(destp, WALK_REGULAR | WALK_MAY_CREATE, MODE_WRITE); 70 if (df < 0) 71 71 return EIO; 72 72 … … 87 87 88 88 rc = vfs_put(df); 89 if (rc != EOK)89 if (rc < 0) 90 90 return EIO; 91 91 … … 104 104 * @return EOK on success, ENOMEM if out of memory, EIO on I/O error 105 105 */ 106 errno_t futil_rcopy_contents(const char *srcdir, const char *destdir)106 int futil_rcopy_contents(const char *srcdir, const char *destdir) 107 107 { 108 108 DIR *dir; 109 109 struct dirent *de; 110 vfs_stat_t s;110 struct stat s; 111 111 char *srcp, *destp; 112 errno_t rc;112 int rc; 113 113 114 114 dir = opendir(srcdir); … … 158 158 * I/O error, ENOMEM if out of memory 159 159 */ 160 errno_t futil_get_file(const char *srcp, void **rdata, size_t *rsize)160 int futil_get_file(const char *srcp, void **rdata, size_t *rsize) 161 161 { 162 162 int sf; 163 163 size_t nr; 164 errno_t rc;164 int rc; 165 165 size_t fsize; 166 166 char *data; 167 vfs_stat_t st;168 169 rc = vfs_lookup_open(srcp, WALK_REGULAR, MODE_READ, &sf);170 if ( rc != EOK)167 struct stat st; 168 169 sf = vfs_lookup_open(srcp, WALK_REGULAR, MODE_READ); 170 if (sf < 0) 171 171 return ENOENT; 172 172
Note:
See TracChangeset
for help on using the changeset viewer.