2 * Copyright (C) 2009 Sony Computer Entertainment Inc.
3 * Copyright 2009 Sony Corp.
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; version 2 of the License.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 #if defined(HAVE_CONFIG_H)
28 #include <sys/types.h>
32 #include <system/system.h>
33 #include <process/process.h>
34 #include "talloc/talloc.h"
35 #include "ui-system.h"
38 * pb_start_daemon - start the pb-discover daemon.
41 int pb_start_daemon(void *ctx)
43 struct process *process;
48 process = process_create(ctx);
50 argv = talloc_array(process, const char *, 2);
51 name = talloc_asprintf(process, "%s/sbin/pb-discover",
52 pb_system_apps.prefix);
60 result = process_run_async(process);
61 process_release(process);
67 * pb_elf_hash - Standard elf hash routine.
70 unsigned int pb_elf_hash(const char *str)
72 unsigned int h = 0, g;
75 h = (h << 4) + *str++;
81 pb_log("%s: %x\n", __func__, h);
86 * pb_cat_hash - Hashes concatenation of two strings.
89 unsigned int pb_cat_hash(const char *a, const char *b)
94 s = talloc_asprintf(NULL, "%s%s", a, b);