Rocket start from everywhere

This commit is contained in:
Kuba Winnicki 2017-02-21 14:11:22 +01:00
parent 5578fb9fdf
commit f3921b8bc0

View File

@ -284,7 +284,7 @@ static int save_track(const struct sync_track *t, const char *path)
return 0;
}
void sync_save_tracks(const struct sync_device *d)
void sync_save_tracks(const struct sync_device *d, int row)
{
int i;
@ -315,9 +315,12 @@ void sync_save_tracks(const struct sync_device *d)
if (pid == 0)
{
char path[1024];
char def_track_start[64];
snprintf(def_track_start, 64, "TRACK_START_ROW=%d", row);
getcwd(path, 1024);
dprintf(2, "making in %s...\n", path);
execv("/usr/bin/make", (char *[]){ "make", "run_kick", NULL });
execv("/usr/bin/make", (char *[]){ "make", "run", def_track_start, NULL });
}
else if (i > 0)
{
@ -431,7 +434,6 @@ int sync_update(struct sync_device *d, int row, struct sync_cb *cb,
/* look for new commands */
while (socket_poll(d->sock)) {
unsigned char cmd = 0, flag;
uint32_t row;
if (xrecv(d->sock, (char *)&cmd, 1, 0))
goto sockerr;
@ -457,7 +459,7 @@ int sync_update(struct sync_device *d, int row, struct sync_cb *cb,
cb->pause(cb_param, flag);
break;
case SAVE_TRACKS:
sync_save_tracks(d);
sync_save_tracks(d, row);
break;
default:
fprintf(stderr, "unknown cmd: %02x\n", cmd);