umid.c (e5451c8f8330e03ad3cfa16048b4daf961af434f) umid.c (0936d4f3d5a3d5daf453bc341f02ba4e68cfe40e)
1/*
2 * Copyright (C) 2001 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
3 * Licensed under the GPL
4 */
5
6#include <asm/errno.h>
7#include <init.h>
8#include <kern.h>
9#include <os.h>
10
11/* Changed by set_umid_arg */
12static int umid_inited = 0;
13
14static int __init set_umid_arg(char *name, int *add)
15{
16 int err;
17
18 if (umid_inited) {
1/*
2 * Copyright (C) 2001 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
3 * Licensed under the GPL
4 */
5
6#include <asm/errno.h>
7#include <init.h>
8#include <kern.h>
9#include <os.h>
10
11/* Changed by set_umid_arg */
12static int umid_inited = 0;
13
14static int __init set_umid_arg(char *name, int *add)
15{
16 int err;
17
18 if (umid_inited) {
19 printf("umid already set\n");
19 os_warn("umid already set\n");
20 return 0;
21 }
22
23 *add = 0;
24 err = set_umid(name);
25 if (err == -EEXIST)
20 return 0;
21 }
22
23 *add = 0;
24 err = set_umid(name);
25 if (err == -EEXIST)
26 printf("umid '%s' already in use\n", name);
26 os_warn("umid '%s' already in use\n", name);
27 else if (!err)
28 umid_inited = 1;
29
30 return 0;
31}
32
33__uml_setup("umid=", set_umid_arg,
34"umid=<name>\n"
35" This is used to assign a unique identity to this UML machine and\n"
36" is used for naming the pid file and management console socket.\n\n"
37);
38
27 else if (!err)
28 umid_inited = 1;
29
30 return 0;
31}
32
33__uml_setup("umid=", set_umid_arg,
34"umid=<name>\n"
35" This is used to assign a unique identity to this UML machine and\n"
36" is used for naming the pid file and management console socket.\n\n"
37);
38