Lines Matching refs:fd
51 * Returns -1 on error, else the fd of the created template.
56 int fd;
59 if ((fd = open(CONTRACT_TEMPLATE_PATH, O_RDWR)) == -1) {
73 if (((err = ct_pr_tmpl_set_param(fd,
75 ((err = ct_pr_tmpl_set_fatal(fd, CT_PR_EV_HWERR)) != 0) ||
76 ((err = ct_tmpl_set_critical(fd, 0)) != 0) ||
77 ((err = ct_tmpl_set_informative(fd, 0)) != 0)) {
81 (void) close(fd);
85 return (fd);
169 /* Returns -1 on error (with errno set), else fd. */
183 int fd;
187 if ((fd = open_contract_ctl_file(ctid)) == -1) {
205 if ((err = ct_ctl_adopt(fd)) != 0) {
212 err = close(fd);
214 error_msg(gettext("Could not close file descriptor %d."), fd);
223 int fd;
228 if ((fd = open_contract_ctl_file(ctid)) == -1) {
234 if ((err = ct_ctl_abandon(fd)) != 0) {
235 (void) close(fd);
241 (void) close(fd);