Deleted Added
full compact
devd.cc (210610) devd.cc (213646)
1/*-
2 * Copyright (c) 2002-2010 M. Warner Losh.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 49 unchanged lines hidden (view full) ---

58 */
59
60// TODO list:
61// o devd.conf and devd man pages need a lot of help:
62// - devd needs to document the unix domain socket
63// - devd.conf needs more details on the supported statements.
64
65#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2002-2010 M. Warner Losh.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 49 unchanged lines hidden (view full) ---

58 */
59
60// TODO list:
61// o devd.conf and devd man pages need a lot of help:
62// - devd needs to document the unix domain socket
63// - devd.conf needs more details on the supported statements.
64
65#include <sys/cdefs.h>
66__FBSDID("$FreeBSD: head/sbin/devd/devd.cc 210610 2010-07-29 16:06:40Z lulf $");
66__FBSDID("$FreeBSD: head/sbin/devd/devd.cc 213646 2010-10-09 07:29:13Z imp $");
67
68#include <sys/param.h>
69#include <sys/socket.h>
70#include <sys/stat.h>
71#include <sys/sysctl.h>
72#include <sys/types.h>
73#include <sys/wait.h>
74#include <sys/un.h>

--- 669 unchanged lines hidden (view full) ---

744 sp = cfg.set_vars(sp);
745 break;
746 case nomatch:
747 //? at location pnp-info on bus
748 sp = strchr(sp, ' ');
749 if (sp == NULL)
750 return; /* Can't happen? */
751 *sp++ = '\0';
67
68#include <sys/param.h>
69#include <sys/socket.h>
70#include <sys/stat.h>
71#include <sys/sysctl.h>
72#include <sys/types.h>
73#include <sys/wait.h>
74#include <sys/un.h>

--- 669 unchanged lines hidden (view full) ---

744 sp = cfg.set_vars(sp);
745 break;
746 case nomatch:
747 //? at location pnp-info on bus
748 sp = strchr(sp, ' ');
749 if (sp == NULL)
750 return; /* Can't happen? */
751 *sp++ = '\0';
752 while (isspace(*sp))
753 sp++;
752 if (strncmp(sp, "at ", 3) == 0)
753 sp += 3;
754 sp = cfg.set_vars(sp);
754 if (strncmp(sp, "at ", 3) == 0)
755 sp += 3;
756 sp = cfg.set_vars(sp);
757 while (isspace(*sp))
758 sp++;
755 if (strncmp(sp, "on ", 3) == 0)
756 cfg.set_variable("bus", sp + 3);
757 break;
758 case attach: /*FALLTHROUGH*/
759 case detach:
760 sp = strchr(sp, ' ');
761 if (sp == NULL)
762 return; /* Can't happen? */
763 *sp++ = '\0';
764 cfg.set_variable("device-name", buffer);
759 if (strncmp(sp, "on ", 3) == 0)
760 cfg.set_variable("bus", sp + 3);
761 break;
762 case attach: /*FALLTHROUGH*/
763 case detach:
764 sp = strchr(sp, ' ');
765 if (sp == NULL)
766 return; /* Can't happen? */
767 *sp++ = '\0';
768 cfg.set_variable("device-name", buffer);
769 while (isspace(*sp))
770 sp++;
765 if (strncmp(sp, "at ", 3) == 0)
766 sp += 3;
767 sp = cfg.set_vars(sp);
771 if (strncmp(sp, "at ", 3) == 0)
772 sp += 3;
773 sp = cfg.set_vars(sp);
774 while (isspace(*sp))
775 sp++;
768 if (strncmp(sp, "on ", 3) == 0)
769 cfg.set_variable("bus", sp + 3);
770 break;
771 }
772
773 cfg.find_and_execute(type);
774 cfg.pop_var_table();
775}

--- 280 unchanged lines hidden ---
776 if (strncmp(sp, "on ", 3) == 0)
777 cfg.set_variable("bus", sp + 3);
778 break;
779 }
780
781 cfg.find_and_execute(type);
782 cfg.pop_var_table();
783}

--- 280 unchanged lines hidden ---