-static struct wgt *wgt_at_workdir()
-{
- int rc, wfd;
- struct wgt *wgt;
-
- wfd = workdirfd();
- if (wfd < 0)
- return NULL;
-
- wgt = wgt_create();
- if (!wgt) {
- syslog(LOG_ERR, "failed to allocate wgt");
- close(wfd);
- return NULL;
- }
-
- rc = wgt_connectat(wgt, wfd, NULL);
- if (rc) {
- syslog(LOG_ERR, "failed to connect wgt to workdir");
- close(wfd);
- wgt_unref(wgt);
- return NULL;
- }
-
- return wgt;
-}
-
-