/*
Copyright 2015 IoT.bzh
+ author: José Bollo <jose.bollo@iot.bzh>
+
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
close(spipe[1]);
return -1;
}
+ assert(rc == 5);
close(spipe[1]);
return 0;
}
{
int rc;
char *argv[6];
- argv[0] = "/bin/echo";
+ argv[0] = "/usr/bin/echo";
(void)asprintf(&argv[1], "--alias=/icons:%s", FWK_ICON_DIR);
(void)asprintf(&argv[2], "--port=%d", params->port);
(void)asprintf(&argv[3], "--rootdir=%s", desc->path);
- (void)asprintf(&argv[4], "--token=%", desc->path);
+ (void)asprintf(&argv[4], "--token=%s", params->secret);
argv[5] = NULL;
rc = write(fd, &child, sizeof child);
ERROR("can't write master pipe: %m");
return -1;
}
-
+ close(fd);
rc = execve(argv[0], argv, environ);
ERROR("failed to exec master %s: %m", argv[0]);
return rc;