Changeset d5c1051 in mainline for uspace/app
- Timestamp:
- 2017-12-20T22:25:34Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 39b54fe
- Parents:
- 8610c2c
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2017-12-20 22:22:29)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2017-12-20 22:25:34)
- Location:
- uspace/app
- Files:
-
- 28 edited
-
bdsh/cmds/builtins/batch/batch.c (modified) (2 diffs)
-
bdsh/cmds/builtins/cd/cd.c (modified) (1 diff)
-
bdsh/cmds/modules/mkdir/mkdir.c (modified) (3 diffs)
-
bdsh/cmds/modules/mkfile/mkfile.c (modified) (1 diff)
-
bdsh/cmds/modules/mount/mount.c (modified) (1 diff)
-
bdsh/cmds/modules/rm/rm.c (modified) (1 diff)
-
bdsh/exec.c (modified) (1 diff)
-
bdsh/test/toktest.c (modified) (1 diff)
-
blkdump/blkdump.c (modified) (1 diff)
-
date/date.c (modified) (1 diff)
-
download/main.c (modified) (2 diffs)
-
edit/edit.c (modified) (1 diff)
-
fdisk/fdisk.c (modified) (3 diffs)
-
gunzip/gunzip.c (modified) (2 diffs)
-
mkexfat/mkexfat.c (modified) (2 diffs)
-
mkmfs/mkmfs.c (modified) (1 diff)
-
ping/ping.c (modified) (1 diff)
-
pkg/pkg.c (modified) (2 diffs)
-
sbi/src/os/helenos.c (modified) (1 diff)
-
sysinst/sysinst.c (modified) (1 diff)
-
taskdump/elf_core.c (modified) (1 diff)
-
taskdump/taskdump.c (modified) (16 diffs)
-
tester/float/float1.c (modified) (2 diffs)
-
tester/thread/thread1.c (modified) (2 diffs)
-
trace/trace.c (modified) (9 diffs)
-
wavplay/dplay.c (modified) (1 diff)
-
wavplay/drec.c (modified) (1 diff)
-
websrv/websrv.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/bdsh/cmds/builtins/batch/batch.c
r8610c2c rd5c1051 85 85 } 86 86 87 int rc = 0;87 int rc = EOK; 88 88 FILE *batch = fopen(argv[1], "r"); 89 89 if (batch == NULL) { … … 104 104 if (cur == fusr.line) { 105 105 /* skip empty line */ 106 rc = 0;106 rc = EOK; 107 107 free(cur); 108 108 } else { -
uspace/app/bdsh/cmds/builtins/cd/cd.c
r8610c2c rd5c1051 85 85 int cmd_cd(char **argv, cliuser_t *usr) 86 86 { 87 int argc, rc = 0; 87 int argc; 88 int rc = EOK; 88 89 89 90 argc = cli_count_args(argv); -
uspace/app/bdsh/cmds/modules/mkdir/mkdir.c
r8610c2c rd5c1051 94 94 95 95 int ret = 0; 96 int rc; 96 97 97 98 if (!create_parents) { 98 r et= vfs_link_path(path, KIND_DIRECTORY, NULL);99 if (r et!= EOK) {99 rc = vfs_link_path(path, KIND_DIRECTORY, NULL); 100 if (rc != EOK) { 100 101 cli_error(CL_EFAIL, "%s: could not create %s (%s)", 101 cmdname, path, str_error(r et));102 cmdname, path, str_error(rc)); 102 103 ret = 1; 103 104 } … … 135 136 path[prev_off] = 0; 136 137 137 r et= vfs_link_path(path, KIND_DIRECTORY, NULL);138 if (r et != EOK && ret!= EEXIST) {138 rc = vfs_link_path(path, KIND_DIRECTORY, NULL); 139 if (rc != EOK && rc != EEXIST) { 139 140 cli_error(CL_EFAIL, "%s: could not create %s (%s)", 140 cmdname, path, str_error(r et));141 cmdname, path, str_error(rc)); 141 142 ret = 1; 142 143 goto leave; … … 146 147 } 147 148 /* Create the final directory. */ 148 r et= vfs_link_path(path, KIND_DIRECTORY, NULL);149 if (r et!= EOK) {149 rc = vfs_link_path(path, KIND_DIRECTORY, NULL); 150 if (rc != EOK) { 150 151 cli_error(CL_EFAIL, "%s: could not create %s (%s)", 151 cmdname, path, str_error(r et));152 cmdname, path, str_error(rc)); 152 153 ret = 1; 153 154 } -
uspace/app/bdsh/cmds/modules/mkfile/mkfile.c
r8610c2c rd5c1051 202 202 free(buffer); 203 203 204 if (vfs_put(fd) < 0)204 if (vfs_put(fd) != EOK) 205 205 goto error; 206 206 -
uspace/app/bdsh/cmds/modules/mount/mount.c
r8610c2c rd5c1051 132 132 const char *mopts = ""; 133 133 const char *dev = ""; 134 int rc, c, opt_ind; 134 int rc; 135 int c, opt_ind; 135 136 unsigned int instance = 0; 136 137 bool instance_set = false; -
uspace/app/bdsh/cmds/modules/rm/rm.c
r8610c2c rd5c1051 209 209 rc = vfs_unlink_path(path); 210 210 if (rc == EOK) 211 return EOK;211 return 0; 212 212 213 213 cli_error(CL_ENOTSUP, "Can not remove %s", path); -
uspace/app/bdsh/exec.c
r8610c2c rd5c1051 98 98 task_exit_t texit; 99 99 char *tmp; 100 int rc, retval, i; 100 int rc; 101 int retval, i; 101 102 int file_handles[3] = { -1, -1, -1 }; 102 103 FILE *files[3]; -
uspace/app/bdsh/test/toktest.c
r8610c2c rd5c1051 47 47 48 48 int rc = tok_init(&tokenizer, input_buffer, tokens, MAX_TOKENS); 49 PCUT_ASSERT_ INT_EQUALS(EOK, rc);49 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 50 50 51 51 size_t token_count; 52 52 rc = tok_tokenize(&tokenizer, &token_count); 53 PCUT_ASSERT_ INT_EQUALS(EOK, rc);53 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 54 54 55 55 -
uspace/app/blkdump/blkdump.c
r8610c2c rd5c1051 161 161 printf("Device %s has %" PRIuOFF64 " blocks, %" PRIuOFF64 " bytes each\n", dev_path, dev_nblocks, (aoff64_t) block_size); 162 162 163 int ret; 163 164 if (toc) 164 r c= print_toc();165 ret = print_toc(); 165 166 else 166 r c= print_blocks(block_offset, block_count, block_size);167 ret = print_blocks(block_offset, block_count, block_size); 167 168 168 169 block_fini(service_id); 169 170 170 return r c;171 return ret; 171 172 } 172 173 -
uspace/app/date/date.c
r8610c2c rd5c1051 51 51 main(int argc, char **argv) 52 52 { 53 int rc, c; 53 int rc; 54 int c; 54 55 category_id_t cat_id; 55 56 size_t svc_cnt; -
uspace/app/download/main.c
r8610c2c rd5c1051 74 74 http_t *http = NULL; 75 75 int rc; 76 int ret; 76 77 77 78 if (argc < 2) { … … 155 156 } 156 157 } else { 157 r c= asprintf(&server_path, "%s?%s", path, uri->query);158 if (r c< 0) {158 ret = asprintf(&server_path, "%s?%s", path, uri->query); 159 if (ret < 0) { 159 160 fprintf(stderr, "Failed allocating path\n"); 160 161 rc = ENOMEM; -
uspace/app/edit/edit.c
r8610c2c rd5c1051 761 761 } while (!spt_equal(&bep, epos)); 762 762 763 if (fclose(f) != EOK)763 if (fclose(f) < 0) 764 764 return EIO; 765 765 -
uspace/app/fdisk/fdisk.c
r8610c2c rd5c1051 210 210 } 211 211 212 rc= asprintf(&dtext, "%s (%s)", svcname, scap);213 if (r c< 0) {212 int ret = asprintf(&dtext, "%s (%s)", svcname, scap); 213 if (ret < 0) { 214 214 rc = ENOMEM; 215 215 printf("Out of memory.\n"); … … 615 615 label = "(No name)"; 616 616 617 rc= asprintf(&sdesc, "%s %s, %s, %s", label,617 int ret = asprintf(&sdesc, "%s %s, %s, %s", label, 618 618 scap, spkind, sfstype); 619 if (r c< 0) {619 if (ret < 0) { 620 620 rc = ENOMEM; 621 621 goto error; … … 623 623 624 624 } else { 625 rc= asprintf(&sdesc, "%s, %s", scap, spkind);626 if (r c< 0) {625 int ret = asprintf(&sdesc, "%s, %s", scap, spkind); 626 if (ret < 0) { 627 627 rc = ENOMEM; 628 628 goto error; -
uspace/app/gunzip/gunzip.c
r8610c2c rd5c1051 58 58 } 59 59 60 rc = fseek(f, 0, SEEK_END); 61 if (rc != 0) { 60 if (fseek(f, 0, SEEK_END) < 0) { 62 61 printf("Error determining size of '%s'\n", argv[1]); 63 62 fclose(f); … … 72 71 } 73 72 74 rc = fseek(f, 0, SEEK_SET); 75 if (rc != 0) { 73 if (fseek(f, 0, SEEK_SET) < 0) { 76 74 printf ("Error rewinding '%s'\n", argv[1]); 77 75 fclose(f); -
uspace/app/mkexfat/mkexfat.c
r8610c2c rd5c1051 351 351 { 352 352 uint32_t *ebs = calloc(cfg->sector_size, sizeof(uint8_t)); 353 int i, rc; 353 int i; 354 int rc; 354 355 355 356 if (!ebs) … … 757 758 char *dev_path; 758 759 service_id_t service_id; 759 int rc, c, opt_ind; 760 int rc; 761 int c, opt_ind; 760 762 aoff64_t user_fs_size = 0; 761 763 -
uspace/app/mkmfs/mkmfs.c
r8610c2c rd5c1051 109 109 int main (int argc, char **argv) 110 110 { 111 int rc, c, opt_ind; 111 int rc; 112 int c, opt_ind; 112 113 char *device_name; 113 114 size_t devblock_size; -
uspace/app/ping/ping.c
r8610c2c rd5c1051 290 290 } 291 291 292 rc = asprintf(&sdest, "%s (%s)", host, adest); 293 if (rc < 0) { 292 if (asprintf(&sdest, "%s (%s)", host, adest) < 0) { 294 293 printf("Out of memory.\n"); 295 294 goto error; -
uspace/app/pkg/pkg.c
r8610c2c rd5c1051 107 107 char *fnunpack; 108 108 int rc; 109 int ret; 109 110 110 111 if (argc != 3) { … … 115 116 pkg_name = argv[2]; 116 117 117 r c= asprintf(&src_uri, "http://ci.helenos.org/latest/" STRING(UARCH)118 ret = asprintf(&src_uri, "http://ci.helenos.org/latest/" STRING(UARCH) 118 119 "/%s-for-helenos-" STRING(UARCH) ".tar.gz", 119 120 pkg_name); 120 if (r c< 0) {121 if (ret < 0) { 121 122 printf("Out of memory.\n"); 122 123 return ENOMEM; 123 124 } 124 125 125 r c= asprintf(&fname, "/tmp/%s-for-helenos-" STRING(UARCH)126 ret = asprintf(&fname, "/tmp/%s-for-helenos-" STRING(UARCH) 126 127 ".tar.gz", pkg_name); 127 if (r c< 0) {128 if (ret < 0) { 128 129 printf("Out of memory.\n"); 129 130 return ENOMEM; 130 131 } 131 132 132 r c= asprintf(&fnunpack, "/tmp/%s-for-helenos-" STRING(UARCH) ".tar",133 ret = asprintf(&fnunpack, "/tmp/%s-for-helenos-" STRING(UARCH) ".tar", 133 134 pkg_name); 134 if (r c< 0) {135 if (ret < 0) { 135 136 printf("Out of memory.\n"); 136 137 return ENOMEM; -
uspace/app/sbi/src/os/helenos.c
r8610c2c rd5c1051 252 252 task_wait_t twait; 253 253 task_exit_t texit; 254 int rc, retval; 254 int rc; 255 int retval; 255 256 256 257 rc = task_spawnv(&tid, &twait, cmd[0], (char const * const *) cmd); -
uspace/app/sysinst/sysinst.c
r8610c2c rd5c1051 142 142 143 143 /* XXX libfdisk should give us the service name */ 144 rc = asprintf(pdev, "%sp1", dev); 145 if (rc < 0) 144 if (asprintf(pdev, "%sp1", dev) < 0) 146 145 return ENOMEM; 147 146 -
uspace/app/taskdump/elf_core.c
r8610c2c rd5c1051 307 307 to_copy = min(area->size - total, BUFFER_SIZE); 308 308 rc = udebug_mem_read(sess, buffer, addr, to_copy); 309 if (rc < 0) {309 if (rc != EOK) { 310 310 printf("Failed reading task memory.\n"); 311 311 return EIO; -
uspace/app/taskdump/taskdump.c
r8610c2c rd5c1051 92 92 93 93 rc = connect_task(task_id); 94 if (rc < 0) {94 if (rc != EOK) { 95 95 printf("Failed connecting to task %" PRIu64 ".\n", task_id); 96 96 return 1; … … 105 105 106 106 rc = threads_dump(); 107 if (rc < 0)107 if (rc != EOK) 108 108 printf("Failed dumping threads.\n"); 109 109 110 110 rc = areas_dump(); 111 if (rc < 0)111 if (rc != EOK) 112 112 printf("Failed dumping address space areas.\n"); 113 113 114 114 rc = fibrils_dump(app_symtab, sess); 115 if (rc < 0)115 if (rc != EOK) 116 116 printf("Failed dumping fibrils.\n"); 117 117 … … 141 141 142 142 int rc = udebug_begin(ksess); 143 if (rc < 0) {143 if (rc != EOK) { 144 144 printf("udebug_begin() -> %s\n", str_error_name(rc)); 145 145 return rc; … … 223 223 /* TODO: See why NULL does not work. */ 224 224 rc = udebug_thread_read(sess, &dummy_buf, 0, &copied, &needed); 225 if (rc < 0) {225 if (rc != EOK) { 226 226 printf("udebug_thread_read() -> %s\n", str_error_name(rc)); 227 227 return rc; … … 237 237 238 238 rc = udebug_thread_read(sess, thash_buf, buf_size, &copied, &needed); 239 if (rc < 0) {239 if (rc != EOK) { 240 240 printf("udebug_thread_read() -> %s\n", str_error_name(rc)); 241 241 return rc; … … 272 272 273 273 rc = udebug_areas_read(sess, &dummy_buf, 0, &copied, &needed); 274 if (rc < 0) {274 if (rc != EOK) { 275 275 printf("udebug_areas_read() -> %s\n", str_error_name(rc)); 276 276 return rc; … … 281 281 282 282 rc = udebug_areas_read(sess, ainfo_buf, buf_size, &copied, &needed); 283 if (rc < 0) {283 if (rc != EOK) { 284 284 printf("udebug_areas_read() -> %s\n", str_error_name(rc)); 285 285 return rc; … … 357 357 358 358 rc = udebug_regs_read(sess, thash, &istate); 359 if (rc < 0) {359 if (rc != EOK) { 360 360 printf("Failed reading registers: %s.\n", str_error_name(rc)); 361 361 return EIO; … … 386 386 387 387 rc = udebug_mem_read(sess, &data, addr, sizeof(data)); 388 if (rc < 0) {388 if (rc != EOK) { 389 389 printf("Warning: udebug_mem_read() failed.\n"); 390 390 return rc; … … 400 400 char *file_name; 401 401 int rc; 402 int ret; 402 403 403 404 assert(app_name != NULL); 404 405 assert(app_symtab == NULL); 405 406 406 r c= asprintf(&file_name, "/app/%s", app_name);407 if (r c< 0) {407 ret = asprintf(&file_name, "/app/%s", app_name); 408 if (ret < 0) { 408 409 printf("Memory allocation failure.\n"); 409 410 exit(1); … … 419 420 free(file_name); 420 421 421 r c= asprintf(&file_name, "/srv/%s", app_name);422 if (r c< 0) {422 ret = asprintf(&file_name, "/srv/%s", app_name); 423 if (ret < 0) { 423 424 printf("Memory allocation failure.\n"); 424 425 exit(1); … … 432 433 } 433 434 434 r c= asprintf(&file_name, "/drv/%s/%s", app_name, app_name);435 if (r c< 0) {435 ret = asprintf(&file_name, "/drv/%s/%s", app_name, app_name); 436 if (ret < 0) { 436 437 printf("Memory allocation failure.\n"); 437 438 exit(1); … … 457 458 458 459 rc = udebug_name_read(sess, &dummy_buf, 0, &copied, &needed); 459 if (rc < 0)460 if (rc != EOK) 460 461 return NULL; 461 462 … … 463 464 name = malloc(name_size + 1); 464 465 rc = udebug_name_read(sess, name, name_size, &copied, &needed); 465 if (rc < 0) {466 if (rc != EOK) { 466 467 free(name); 467 468 return NULL; … … 488 489 size_t offs; 489 490 int rc; 491 int ret; 490 492 char *str; 491 493 … … 497 499 498 500 if (rc == EOK) { 499 r c= asprintf(&str, "%p (%s+%zu)", (void *) addr, name, offs);501 ret = asprintf(&str, "%p (%s+%zu)", (void *) addr, name, offs); 500 502 } else { 501 r c= asprintf(&str, "%p", (void *) addr);502 } 503 504 if (r c< 0) {503 ret = asprintf(&str, "%p", (void *) addr); 504 } 505 506 if (ret < 0) { 505 507 printf("Memory allocation error.\n"); 506 508 exit(1); -
uspace/app/tester/float/float1.c
r8610c2c rd5c1051 28 28 */ 29 29 30 #include <errno.h> 30 31 #include <stdio.h> 31 32 #include <stdlib.h> … … 75 76 TPRINTF("Creating threads"); 76 77 for (unsigned int i = 0; i < THREADS; i++) { 77 if (thread_create(e, NULL, "e", NULL) < 0) {78 if (thread_create(e, NULL, "e", NULL) != EOK) { 78 79 TPRINTF("\nCould not create thread %u\n", i); 79 80 break; -
uspace/app/tester/thread/thread1.c
r8610c2c rd5c1051 32 32 33 33 #include <atomic.h> 34 #include <errno.h> 34 35 #include <thread.h> 35 36 #include <stdio.h> … … 61 62 TPRINTF("Creating threads"); 62 63 for (i = 0; i < THREADS; i++) { 63 if (thread_create(threadtest, NULL, "threadtest", NULL) < 0) {64 if (thread_create(threadtest, NULL, "threadtest", NULL) != EOK) { 64 65 TPRINTF("\nCould not create thread %u\n", i); 65 66 break; -
uspace/app/trace/trace.c
r8610c2c rd5c1051 162 162 163 163 int rc = udebug_begin(ksess); 164 if (rc < 0) {164 if (rc != EOK) { 165 165 printf("udebug_begin() -> %s\n", str_error_name(rc)); 166 166 return rc; … … 168 168 169 169 rc = udebug_set_evmask(ksess, UDEBUG_EM_ALL); 170 if (rc < 0) {170 if (rc != EOK) { 171 171 printf("udebug_set_evmask(0x%x) -> %s\n ", UDEBUG_EM_ALL, str_error_name(rc)); 172 172 return rc; … … 186 186 rc = udebug_thread_read(sess, thread_hash_buf, 187 187 THBUF_SIZE*sizeof(unsigned), &tb_copied, &tb_needed); 188 if (rc < 0) {188 if (rc != EOK) { 189 189 printf("udebug_thread_read() -> %s\n", str_error_name(rc)); 190 190 return rc; … … 325 325 rc = udebug_mem_read(sess, &call, sc_args[0], sizeof(call)); 326 326 327 if (rc >= 0)327 if (rc == EOK) 328 328 ipcp_call_in(&call, sc_rc); 329 329 } … … 338 338 rc = udebug_args_read(sess, thread_hash, sc_args); 339 339 340 if (rc < 0) {340 if (rc != EOK) { 341 341 printf("error\n"); 342 342 return; … … 368 368 // printf("[%d] ", thread_id); 369 369 370 if (rc < 0) {370 if (rc != EOK) { 371 371 printf("error\n"); 372 372 return; … … 445 445 } 446 446 447 if (rc >= 0) {447 if (rc == EOK) { 448 448 switch (ev_type) { 449 449 case UDEBUG_EVENT_SYSCALL_B: … … 603 603 604 604 rc = get_thread_list(); 605 if (rc < 0) {605 if (rc != EOK) { 606 606 printf("Failed to get thread list (%s)\n", str_error(rc)); 607 607 return; … … 859 859 860 860 rc = connect_task(task_id); 861 if (rc < 0) {861 if (rc != EOK) { 862 862 printf("Failed connecting to task %" PRIu64 ".\n", task_id); 863 863 return 1; -
uspace/app/wavplay/dplay.c
r8610c2c rd5c1051 329 329 * @param device The device. 330 330 * @param file The file. 331 * @return Error code.331 * @return 0 on success, non-zero on failure. 332 332 */ 333 333 int dplay(const char *device, const char *file) -
uspace/app/wavplay/drec.c
r8610c2c rd5c1051 170 170 * @param device The device. 171 171 * @param file The file. 172 * @return Error code.172 * @return 0 on succes, non-zero on failure. 173 173 */ 174 174 int drecord(const char *device, const char *file) -
uspace/app/websrv/websrv.c
r8610c2c rd5c1051 259 259 uri = "/index.html"; 260 260 261 rc = asprintf(&fname, "%s%s", WEB_ROOT, uri); 262 if (rc < 0) { 261 if (asprintf(&fname, "%s%s", WEB_ROOT, uri) < 0) { 263 262 rc = ENOMEM; 264 263 goto out;
Note:
See TracChangeset
for help on using the changeset viewer.
