core: replace 'slave' with 'secondary'
This commit is contained in:
@@ -38,7 +38,7 @@
|
|||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int main;
|
int main;
|
||||||
int slave;
|
int secondary;
|
||||||
gboolean valid;
|
gboolean valid;
|
||||||
pid_t child;
|
pid_t child;
|
||||||
} TestData;
|
} TestData;
|
||||||
@@ -253,7 +253,7 @@ test_verinfo (TestData *d)
|
|||||||
|
|
||||||
if (cpid == 0) {
|
if (cpid == 0) {
|
||||||
/* In the child */
|
/* In the child */
|
||||||
qcdm_test_child (d->slave, (GAsyncReadyCallback)qcdm_verinfo_expect_success_cb);
|
qcdm_test_child (d->secondary, (GAsyncReadyCallback)qcdm_verinfo_expect_success_cb);
|
||||||
exit (0);
|
exit (0);
|
||||||
}
|
}
|
||||||
/* Parent */
|
/* Parent */
|
||||||
@@ -305,7 +305,7 @@ test_sierra_cns_rejected (TestData *d)
|
|||||||
|
|
||||||
if (cpid == 0) {
|
if (cpid == 0) {
|
||||||
/* In the child */
|
/* In the child */
|
||||||
qcdm_test_child (d->slave, (GAsyncReadyCallback)qcdm_verinfo_expect_fail_cb);
|
qcdm_test_child (d->secondary, (GAsyncReadyCallback)qcdm_verinfo_expect_fail_cb);
|
||||||
exit (0);
|
exit (0);
|
||||||
}
|
}
|
||||||
/* Parent */
|
/* Parent */
|
||||||
@@ -341,7 +341,7 @@ test_random_data_rejected (TestData *d)
|
|||||||
|
|
||||||
if (cpid == 0) {
|
if (cpid == 0) {
|
||||||
/* In the child */
|
/* In the child */
|
||||||
qcdm_test_child (d->slave, (GAsyncReadyCallback)qcdm_verinfo_expect_fail_cb);
|
qcdm_test_child (d->secondary, (GAsyncReadyCallback)qcdm_verinfo_expect_fail_cb);
|
||||||
exit (0);
|
exit (0);
|
||||||
}
|
}
|
||||||
/* Parent */
|
/* Parent */
|
||||||
@@ -381,7 +381,7 @@ test_leading_frame_markers (TestData *d)
|
|||||||
|
|
||||||
if (cpid == 0) {
|
if (cpid == 0) {
|
||||||
/* In the child */
|
/* In the child */
|
||||||
qcdm_test_child (d->slave, (GAsyncReadyCallback)qcdm_verinfo_expect_success_cb);
|
qcdm_test_child (d->secondary, (GAsyncReadyCallback)qcdm_verinfo_expect_success_cb);
|
||||||
exit (0);
|
exit (0);
|
||||||
}
|
}
|
||||||
/* Parent */
|
/* Parent */
|
||||||
@@ -403,17 +403,17 @@ test_pty_create (TestData *d)
|
|||||||
struct termios stbuf;
|
struct termios stbuf;
|
||||||
int ret, err;
|
int ret, err;
|
||||||
|
|
||||||
ret = openpty (&d->main, &d->slave, NULL, NULL, NULL);
|
ret = openpty (&d->main, &d->secondary, NULL, NULL, NULL);
|
||||||
g_assert (ret == 0);
|
g_assert (ret == 0);
|
||||||
d->valid = TRUE;
|
d->valid = TRUE;
|
||||||
|
|
||||||
/* set raw mode on the slave using kernel default parameters */
|
/* set raw mode on the secondary using kernel default parameters */
|
||||||
memset (&stbuf, 0, sizeof (stbuf));
|
memset (&stbuf, 0, sizeof (stbuf));
|
||||||
tcgetattr (d->slave, &stbuf);
|
tcgetattr (d->secondary, &stbuf);
|
||||||
tcflush (d->slave, TCIOFLUSH);
|
tcflush (d->secondary, TCIOFLUSH);
|
||||||
cfmakeraw (&stbuf);
|
cfmakeraw (&stbuf);
|
||||||
tcsetattr (d->slave, TCSANOW, &stbuf);
|
tcsetattr (d->secondary, TCSANOW, &stbuf);
|
||||||
fcntl (d->slave, F_SETFL, O_NONBLOCK);
|
fcntl (d->secondary, F_SETFL, O_NONBLOCK);
|
||||||
|
|
||||||
fcntl (d->main, F_SETFL, O_NONBLOCK);
|
fcntl (d->main, F_SETFL, O_NONBLOCK);
|
||||||
err = qcdm_port_setup (d->main);
|
err = qcdm_port_setup (d->main);
|
||||||
@@ -431,8 +431,8 @@ test_pty_cleanup (TestData *d)
|
|||||||
kill (d->child, SIGKILL);
|
kill (d->child, SIGKILL);
|
||||||
if (d->main >= 0)
|
if (d->main >= 0)
|
||||||
close (d->main);
|
close (d->main);
|
||||||
if (d->slave >= 0)
|
if (d->secondary >= 0)
|
||||||
close (d->slave);
|
close (d->secondary);
|
||||||
memset (d, 0, sizeof (*d));
|
memset (d, 0, sizeof (*d));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user