Changeset d545d03 in mainline for uspace/srv/hid/remcons/remcons.c
- Timestamp:
- 2012-01-12T08:38:13Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5923cf82
- Parents:
- 8562724
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/remcons/remcons.c
r8562724 rd545d03 193 193 194 194 if (rc != EOK) { 195 printf("Problem sending data: %s\n", str_error(rc));196 195 async_answer_0(callid, rc); 197 196 break; … … 242 241 } 243 242 244 printf("New user for service %s.\n", user->service_name);243 telnet_user_log(user, "New client connected (%" PRIxn").", iid); 245 244 246 245 /* Accept the connection, increment reference. */ … … 255 254 /* Announce user disconnection. */ 256 255 telnet_user_notify_client_disconnected(user); 256 telnet_user_log(user, "Client disconnected (%" PRIxn").", iid); 257 257 } 258 258 … … 268 268 rc = task_spawnl(&task, APP_GETTERM, APP_GETTERM, term, "/app/bdsh", NULL); 269 269 if (rc != EOK) { 270 printf("%s: Error spawning %s -w %s %s (%s)\n", NAME,270 telnet_user_error(user, "Spawning %s %s %s failed: %s.", 271 271 APP_GETTERM, term, "/app/bdsh", str_error(rc)); 272 272 fibril_mutex_lock(&user->refcount_mutex); … … 284 284 int task_retval; 285 285 task_wait(task, &task_exit, &task_retval); 286 printf("%s: getterm terminated: %d, %d\n", NAME, task_exit, task_retval); 286 telnet_user_log(user, "%s terminated %s, exit code %d.", APP_GETTERM, 287 task_exit == TASK_EXIT_NORMAL ? "normally" : "unexpectedly", 288 task_retval); 287 289 288 290 /* Announce destruction. */ … … 308 310 rc = loc_service_register(user->service_name, &user->service_id); 309 311 if (rc != EOK) { 310 fprintf(stderr, "%s: Unable to register device %s\n", NAME,311 user->service_name );312 telnet_user_error(user, "Unable to register %s with loc: %s.", 313 user->service_name, str_error(rc)); 312 314 return EOK; 313 315 } 314 printf("Service %s registered as %" PRIun "\n", user->service_name, 315 user->service_id); 316 317 telnet_user_log(user, "Service %s registerd with id %" PRIun ".", 318 user->service_name, user->service_id); 316 319 317 320 fid_t spawn_fibril = fibril_create(spawn_task_fibril, user); … … 337 340 rc = loc_service_unregister(user->service_id); 338 341 if (rc != EOK) { 339 fprintf(stderr, "Warning: failed to unregister %s: %s\n", user->service_name, str_error(rc)); 340 } 341 342 printf("Destroying service %s.\n", user->service_name); 342 telnet_user_error(user, 343 "Unable to unregister %s from loc: %s (ignored).", 344 user->service_name, str_error(rc)); 345 } 346 347 telnet_user_log(user, "Destroying..."); 343 348 telnet_user_destroy(user); 344 349 … … 352 357 int rc = loc_server_register(NAME, client_connection); 353 358 if (rc < 0) { 354 printf("%s: Unable to register server (%s).\n", NAME,359 fprintf(stderr, NAME ": Unable to register server: %s.\n", 355 360 str_error(rc)); 356 361 return 1; … … 365 370 &addr.sin_addr.s_addr); 366 371 if (rc != EOK) { 367 fprintf(stderr, "Error parsing network address (%s)\n",372 fprintf(stderr, "Error parsing network address: %s.\n", 368 373 str_error(rc)); 369 374 return 2; … … 372 377 int listen_sd = socket(PF_INET, SOCK_STREAM, 0); 373 378 if (listen_sd < 0) { 374 fprintf(stderr, "Error creating listening socket (%s)\n",379 fprintf(stderr, "Error creating listening socket: %s.\n", 375 380 str_error(listen_sd)); 376 381 return 3; … … 379 384 rc = bind(listen_sd, (struct sockaddr *) &addr, sizeof(addr)); 380 385 if (rc != EOK) { 381 fprintf(stderr, "Error binding socket (%s)\n",386 fprintf(stderr, "Error binding socket: %s.\n", 382 387 str_error(rc)); 383 388 return 4; … … 386 391 rc = listen(listen_sd, BACKLOG_SIZE); 387 392 if (rc != EOK) { 388 fprintf(stderr, "listen() failed (%s)\n", str_error(rc));393 fprintf(stderr, "listen() failed: %s.\n", str_error(rc)); 389 394 return 5; 390 395 } … … 399 404 400 405 if (conn_sd < 0) { 401 fprintf(stderr, "accept() failed (%s)\n", str_error(rc)); 406 fprintf(stderr, "accept() failed: %s.\n", 407 str_error(rc)); 402 408 continue; 403 409 }
Note:
See TracChangeset
for help on using the changeset viewer.