And remove the hard-coded path.
enum scheme ["local"; "ssh"]
entry_point local void set_scheme (enum scheme scheme)
entry_point local void set_hostname (string hostname)
+entry_point local void set_wrappid_path (string wrappid)
}
void
+wrap_set_wrappid_path (wrap_h *w, const char *wrappid)
+{
+ if (wrappid == NULL || strlen (wrappid) == 0 || wrappid[0] != '/') {
+ set_error ("invalid path");
+ return;
+ }
+ w->wrappid_path = strdup (wrappid);
+ if (!w->wrappid_path)
+ set_error_errno ("strdup");
+}
+
+void
wrap_int_make_request (wrap_h *w, int proc_nr, const void *args, void *ret)
{
switch (w->scheme) {
*/
wrap_scheme_enum scheme;
char *hostname;
+ char *wrappid_path;
};
/* Declare an error, setting the error field in the handle. */
"ssh",
"-T", "-o", "BatchMode=yes", "-e", "none",
w->hostname,
- "sh", "-c", /*XXX*/ "/home/rjones/d/wrappi/daemon/wrappid",
+ "sh", "-c", w->wrappid_path ? : "wrappid",
NULL);
perror ("ssh");
_exit (EXIT_FAILURE);
fclose (w->wfp);
free (w->hostname);
+ free (w->wrappid_path);
free (w);
}