Skip to content

Commit 49c8bf1

Browse files
committed
emcmodule: fix copy paste errors
Remove duplicate echo_serial_number entry Fix null pointer check in Command_init to test s instead of c Add missing strerror(errno) argument to error message
1 parent f82c475 commit 49c8bf1

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

src/emc/usr_intf/axis/extensions/emcmodule.cc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,6 @@ static PyMethodDef Stat_methods[] = {
418418
#define O(x) offsetof(pyStatChannel,status.x)
419419
static PyMemberDef Stat_members[] = {
420420
// stat
421-
{(char*)"echo_serial_number", T_INT, O(echo_serial_number), READONLY, NULL},
422421
{(char*)"echo_serial_number", T_INT, O(echo_serial_number), READONLY, NULL},
423422
{(char*)"state", T_INT, O(status), READONLY, NULL},
424423

@@ -936,7 +935,7 @@ static int Command_init(pyCommandChannel *self, PyObject * /*a*/, PyObject * /*k
936935
}
937936
RCS_STAT_CHANNEL *s =
938937
new RCS_STAT_CHANNEL(emcFormat, "emcStatus", "xemc", file);
939-
if(!c) {
938+
if(!s) {
940939
delete s;
941940
PyErr_Format( error, "new RCS_STAT_CHANNEL failed");
942941
return -1;
@@ -1366,7 +1365,7 @@ static PyObject *program_open(pyCommandChannel *s, PyObject *o) {
13661365
m.remote_buffersize = bytes_read;
13671366
/* send chunk */
13681367
if(emcSendCommand(s, m) < 0) {
1369-
PyErr_Format(PyExc_OSError, "emcSendCommand() error: %s");
1368+
PyErr_Format(PyExc_OSError, "emcSendCommand() error: %s", strerror(errno));
13701369
return PyErr_SetFromErrno(PyExc_OSError);
13711370
}
13721371
}

0 commit comments

Comments
 (0)