Changeset 51da086 in mainline
- Timestamp:
- 2020-01-21T15:13:57Z (5 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 14b5c30f
- Parents:
- 01900b6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/init/init.c
r01900b6 r51da086 51 51 #include "init.h" 52 52 53 #define BANNER_LEFT "######> " 54 #define BANNER_RIGHT " <######" 55 53 56 #define ROOT_DEVICE "bd/initrd" 54 57 #define ROOT_MOUNT_POINT "/" … … 81 84 { 82 85 printf("%s: HelenOS init\n", NAME); 86 } 87 88 static void oom_check(errno_t rc, const char *path) 89 { 90 if (rc == ENOMEM) { 91 printf("%sOut-of-memory condition detected%s\n", BANNER_LEFT, 92 BANNER_RIGHT); 93 printf("%sBailing out of the boot process after %s%s\n", 94 BANNER_LEFT, path, BANNER_RIGHT); 95 printf("%sMore physical memory is required%s\n", BANNER_LEFT, 96 BANNER_RIGHT); 97 exit(ENOMEM); 98 } 83 99 } 84 100 … … 199 215 200 216 if (rc != EOK) { 217 oom_check(rc, path); 201 218 printf("%s: Error spawning %s (%s)\n", NAME, path, 202 219 str_error(rc)); … … 279 296 errno_t rc = task_spawnl(&id, &wait, app, app, winreg, NULL); 280 297 if (rc != EOK) { 298 oom_check(rc, app); 281 299 printf("%s: Error spawning %s %s (%s)\n", NAME, app, 282 300 winreg, str_error(rc)); 283 return -1;301 return rc; 284 302 } 285 303 … … 290 308 printf("%s: Error retrieving retval from %s (%s)\n", NAME, 291 309 app, str_error(rc)); 292 return -1;310 return rc; 293 311 } 294 312 … … 304 322 errno_t rc = task_spawnl(NULL, NULL, APP_GETTERM, APP_GETTERM, svc, 305 323 LOCFS_MOUNT_POINT, "--msg", "--wait", "--", app, NULL); 306 if (rc != EOK) 324 if (rc != EOK) { 325 oom_check(rc, APP_GETTERM); 307 326 printf("%s: Error spawning %s %s %s --msg --wait -- %s\n", 308 327 NAME, APP_GETTERM, svc, LOCFS_MOUNT_POINT, app); 328 } 309 329 } else { 310 330 printf("%s: Spawning %s %s %s --wait -- %s\n", NAME, … … 313 333 errno_t rc = task_spawnl(NULL, NULL, APP_GETTERM, APP_GETTERM, svc, 314 334 LOCFS_MOUNT_POINT, "--wait", "--", app, NULL); 315 if (rc != EOK) 335 if (rc != EOK) { 336 oom_check(rc, APP_GETTERM); 316 337 printf("%s: Error spawning %s %s %s --wait -- %s\n", 317 338 NAME, APP_GETTERM, svc, LOCFS_MOUNT_POINT, app); 339 } 318 340 } 319 341 }
Note:
See TracChangeset
for help on using the changeset viewer.