Lines Matching defs:dfd
46 int dfd, fd, len, on;
55 if (0 <= (dfd = open((TT.cpath=dirtree_path(tree, NULL)), O_RDONLY))) {
56 if ((fd = openat(dfd, "type", O_RDONLY)) < 0) goto done;
65 if ((cap = read_int_at(dfd, "capacity")) < 0) {
66 if ((max = read_int_at(dfd, "charge_full")) > 0)
67 curr = read_int_at(dfd, "charge_now");
68 else if ((max = read_int_at(dfd, "energy_full")) > 0)
69 curr = read_int_at(dfd, "energy_now");
75 if ((on = read_int_at(dfd, "online")) >= 0)
79 close(dfd);
87 int dfd, temp;
94 if (0 <= (dfd = open((TT.cpath=dirtree_path(tree, NULL)), O_RDONLY))) {
95 if ((0 < (temp = read_int_at(dfd, "temp"))) || !errno) {
101 close(dfd);
110 int dfd=5, cur, max;
119 if (0 <= (dfd = open((TT.cpath=dirtree_path(tree, &dfd)), O_RDONLY))) {
123 cur=read_int_at(dfd, "cur_state");
124 max=read_int_at(dfd, "max_state");
129 close(dfd);