Lines Matching +full:jd +full:- +full:invert
1 /*-
2 * SPDX-License-Identifier: BSD-3-Clause AND BSD-2-Clause
4 * Copyright (c) 2002-2010 M. Warner Losh <imp@FreeBSD.org>
63 // - devd needs to document the unix domain socket
64 // - devd.conf needs more details on the supported statements.
122 * The kernel sets it to the minimum of a hard-coded maximum value and sbcc *
143 static const char detach = '-';
175 event_proc::event_proc() : _prio(-1) in event_proc()
197 if (!(*i)->do_match(c)) in matches()
208 if (!(*i)->do_action(c)) in run()
248 case -1: /* error */ in my_system()
263 ::execl(_PATH_BSHELL, "sh", "-c", command, (char *)NULL); in my_system()
269 } while (pid == -1 && errno == EINTR); in my_system()
275 return (pid == -1 ? -1 : pstat); in my_system()
310 * log when we're in -d mode. in do_match()
313 devdlog(LOG_DEBUG, "Testing %s=%s against %s, invert=%d\n", in do_match()
329 : _var(var), _type(-1) in media()
335 { -1, "unknown" }, in media()
358 // context where device-name is defined and what we want, in do_match()
360 // the name of interest, first try device-name and fall back in do_match()
362 value = c.get_variable("device-name"); in do_match()
380 } else if (_type == -1) { in do_match()
402 return (i->second); in get_variable()
436 * log when we're in -d mode. in set_variable()
492 if (strcmp(dp->d_name + dp->d_namlen - 5, ".conf") == 0) { in parse_files_in_dir()
494 dirname, dp->d_name); in parse_files_in_dir()
505 return (l1->get_priority() > l2->get_priority()); in operator ()()
568 p->set_priority(prio); in add_attach()
575 p->set_priority(prio); in add_detach()
588 p->set_priority(prio); in add_nomatch()
595 p->set_priority(prio); in add_notify()
626 _var_list_table.back()->set_variable(var, val); in set_variable()
635 if ((*i)->is_set(var)) in get_variable()
636 return ((*i)->get_variable(var)); in get_variable()
645 ch == '-')); in is_id_char()
684 // $$ -> $ in expand_one()
690 // $(foo) -> $(foo) in expand_one()
698 count--; in expand_one()
706 // $[^-A-Za-z_*] -> $\1 in expand_one()
707 if (!isalpha(*src) && *src != '_' && *src != '-' && *src != '*') { in expand_one()
713 // $var -> replace with value in expand_one()
728 * while parsing config files, as tested on 2013-01-30. in expand_string()
741 dst.append(src, var_at - src); in expand_string()
777 rhs[-2] = '\0'; in chop_var()
785 rhs[-1] = '\0'; in chop_var()
836 for (i = l->begin(); i != l->end(); ++i) { in find_and_execute()
837 if ((*i)->matches(*this)) { in find_and_execute()
838 (*i)->run(*this); in find_and_execute()
859 cfg.set_variable("*", buffer - 1); in process_event()
866 asprintf(×tr, "%jd.%06ld", (uintmax_t)tv.tv_sec, tv.tv_usec); in process_event()
878 //? at location pnp-info on bus in process_event()
899 cfg.set_variable("device-name", buffer); in process_event()
934 if (chown(name, 0, 0)) /* XXX - root.wheel */ in create_socket()
960 if (i->socktype == SOCK_SEQPACKET) in notify_clients()
965 if (send(i->fd, data, len, flags) != len) { in notify_clients()
966 --num_clients; in notify_clients()
967 close(i->fd); in notify_clients()
986 * event. This check eliminates the problem of an ever-growing list of in check_clients()
988 * without frequent device-change activity. in check_clients()
992 pfd.fd = i->fd; in check_clients()
996 --num_clients; in check_clients()
997 close(i->fd); in check_clients()
1020 if (s.fd != -1) { in new_client()
1045 if (fd == -1) in event_loop()
1059 // No events -> we've processed all pending events in event_loop()
1104 if (rv == -1) { in event_loop()
1111 rv = read(fd, buffer, sizeof(buffer) - 1); in event_loop()
1114 if (rv == sizeof(buffer) - 1) { in event_loop()
1121 while (buffer[--rv] == '\n') in event_loop()
1192 ep->add(eps); in add_to_event_proc()
1296 fprintf(stderr, "usage: %s [-dnq] [-l connlimit] [-f file]\n", in usage()
1327 while ((ch = getopt(argc, argv, "df:l:nq")) != -1) { in main()