Skip to content

Commit 3ec8e32

Browse files
committed
Merge branch '2.9'
# Conflicts: # .github/workflows/ci.yml # src/emc/rs274ngc/rs274ngc_pre.cc # src/hal/drivers/mesa-hostmot2/hm2_modbus.c # src/libnml/rcs/rcs_print.cc
2 parents 57bce65 + 7242b3f commit 3ec8e32

10 files changed

Lines changed: 87 additions & 76 deletions

File tree

.github/workflows/ci.yml

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ jobs:
3030
- name: Build RIP & test
3131
run: |
3232
set -x
33-
sudo apt-get install -y eatmydata
33+
sudo apt-get --yes -o Acquire::Retries=5 install eatmydata
3434
eatmydata ./scripts/travis-install-build-deps.sh
35-
sudo eatmydata apt --quiet --yes upgrade
35+
sudo eatmydata apt --yes --quiet -o Acquire::Retries=5 upgrade
3636
cd src
3737
eatmydata ./autogen.sh
3838
eatmydata ./configure --disable-check-runtime-deps
@@ -55,10 +55,10 @@ jobs:
5555
- name: Clang build RIP & test
5656
run: |
5757
set -x
58-
sudo apt-get install -y eatmydata
58+
sudo apt-get --yes -o Acquire::Retries=5 install eatmydata
5959
eatmydata ./scripts/travis-install-build-deps.sh
60-
sudo eatmydata apt-get install -y clang
61-
sudo eatmydata apt --quiet --yes upgrade
60+
sudo eatmydata apt-get -y -o Acquire::Retries=5 install clang
61+
sudo eatmydata apt --yes --quiet -o Acquire::Retries=5 upgrade
6262
cd src
6363
eatmydata ./autogen.sh
6464
CC=clang CXX=clang++ eatmydata ./configure --disable-check-runtime-deps
@@ -81,8 +81,8 @@ jobs:
8181
- name: Build HTML docmentation
8282
run: |
8383
./scripts/travis-install-build-deps.sh
84-
sudo apt-get install -y eatmydata
85-
sudo eatmydata apt --quiet --yes upgrade
84+
sudo apt-get -y -o Acquire::Retries=5 install eatmydata
85+
sudo eatmydata apt --yes --quiet -o Acquire::Retries=5 upgrade
8686
cd src
8787
eatmydata ./autogen.sh
8888
eatmydata ./configure --disable-check-runtime-deps --enable-build-documentation=html
@@ -113,11 +113,11 @@ jobs:
113113
run: |
114114
set -e
115115
set -x
116-
apt-get --quiet update
117-
apt-get --yes --quiet install eatmydata curl
118-
eatmydata apt --quiet --yes upgrade
116+
apt-get --quiet -o Acquire::Retries=5 update
117+
apt-get --yes --quiet -o Acquire::Retries=5 install eatmydata curl
118+
eatmydata apt --yes --quiet -o Acquire::Retries=5 upgrade
119119
# Install stuff needed to check out the linuxcnc repo and turn it into a debian source package.
120-
eatmydata apt-get --yes --quiet install --no-install-suggests git lsb-release python3 devscripts
120+
eatmydata apt-get --yes --quiet -o Acquire::Retries=5 install --no-install-suggests git lsb-release python3 devscripts
121121
122122
- uses: actions/checkout@v3
123123
with:
@@ -138,11 +138,11 @@ jobs:
138138
esac
139139
set -e
140140
set -x
141-
eatmydata apt-get --yes --quiet install --no-install-recommends gpg software-properties-common
141+
eatmydata apt-get --yes --quiet -o Acquire::Retries=5 install --no-install-recommends gpg software-properties-common
142142
eatmydata gpg --homedir="${PWD}/gnupg" --output /etc/apt/trusted.gpg.d/linuxcnc-deb-archive.gpg --export 3CB9FD148F374FEF
143143
DIST=$(echo ${{matrix.image}} | cut -d : -f 2)
144144
eatmydata add-apt-repository "deb http://linuxcnc.org $DIST base"
145-
eatmydata apt-get --quiet update
145+
eatmydata apt-get --quiet -o Acquire::Retries=5 update
146146
147147
- name: Build architecture-specific Debian packages
148148
env:
@@ -157,16 +157,16 @@ jobs:
157157
eatmydata debian/update-dch-from-git
158158
eatmydata scripts/get-version-from-git | sed -re 's/^v(.*)$/\1/' >| VERSION; cat VERSION
159159
eatmydata git diff
160-
eatmydata apt-get --yes --quiet build-dep --arch-only .
160+
eatmydata apt-get --yes --quiet -o Acquire::Retries=5 build-dep --arch-only .
161161
eatmydata debuild -us -uc --build=any
162162
- name: Test debian packages
163163
env:
164164
DEBIAN_FRONTEND: noninteractive
165165
run: |
166166
set -e
167167
set -x
168-
eatmydata apt-get --yes --quiet install ../*.deb
169-
eatmydata apt-get --yes --quiet install sudo # some tests run sudo...
168+
eatmydata apt-get --yes --quiet -o Acquire::Retries=5 install ../*.deb
169+
eatmydata apt-get --yes --quiet -o Acquire::Retries=5 install sudo # some tests run sudo...
170170
eatmydata adduser --disabled-password --gecos "" testrunner
171171
eatmydata passwd -d testrunner
172172
eatmydata adduser testrunner sudo
@@ -220,11 +220,11 @@ jobs:
220220
run: |
221221
set -e
222222
set -x
223-
apt-get --quiet update
224-
apt-get --yes --quiet install eatmydata curl
225-
eatmydata apt --quiet --yes upgrade
223+
apt-get --quiet -o Acquire::Retries=5 update
224+
apt-get --yes --quiet -o Acquire::Retries=5 install eatmydata curl
225+
eatmydata apt --yes --quiet -o Acquire::Retries=5 upgrade
226226
# Install stuff needed to check out the linuxcnc repo and turn it into a debian source package.
227-
eatmydata apt-get --yes --quiet install --no-install-suggests git lsb-release python3 devscripts
227+
eatmydata apt-get --yes --quiet -o Acquire::Retries=5 install --no-install-suggests git lsb-release python3 devscripts
228228
229229
- uses: actions/checkout@v3
230230
with:
@@ -245,11 +245,11 @@ jobs:
245245
esac
246246
set -e
247247
set -x
248-
eatmydata apt-get --yes --quiet install gpg software-properties-common
248+
eatmydata apt-get --yes --quiet -o Acquire::Retries=5 install gpg software-properties-common
249249
eatmydata gpg --homedir="${PWD}/gnupg" --output /etc/apt/trusted.gpg.d/linuxcnc-deb-archive.gpg --export 3CB9FD148F374FEF
250250
DIST=$(echo ${{matrix.image}} | cut -d : -f 2)
251251
eatmydata add-apt-repository "deb http://linuxcnc.org $DIST base"
252-
eatmydata apt-get --quiet update
252+
eatmydata apt-get --quiet -o Acquire::Retries=5 update
253253
254254
- name: Build architecture-independent Debian packages
255255
env:
@@ -264,15 +264,15 @@ jobs:
264264
eatmydata debian/update-dch-from-git
265265
eatmydata scripts/get-version-from-git | sed -re 's/^v(.*)$/\1/' >| VERSION; cat VERSION
266266
eatmydata git diff
267-
eatmydata apt-get --yes --quiet build-dep --indep-only .
267+
eatmydata apt-get --yes --quiet -o Acquire::Retries=5 build-dep --indep-only .
268268
eatmydata debuild -us -uc --build=source,all
269269
- name: Test install debian packages
270270
env:
271271
DEBIAN_FRONTEND: noninteractive
272272
run: |
273273
set -e
274274
set -x
275-
eatmydata apt-get --yes --quiet install ../*.deb
275+
eatmydata apt-get --yes --quiet -o Acquire::Retries=5 install ../*.deb
276276
- name: Gather build artifacts
277277
run: |
278278
set -e
@@ -311,7 +311,7 @@ jobs:
311311
run: |
312312
set -x
313313
git fetch --recurse-submodules=no https://github.com/linuxcnc/linuxcnc refs/tags/*:refs/tags/*
314-
sudo apt-get -y install cppcheck shellcheck
314+
sudo apt-get --yes -o Acquire::Retries=5 install cppcheck shellcheck
315315
scripts/cppcheck.sh
316316
- name: Shellcheck
317317
continue-on-error: true

src/emc/canterp/canterp.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -590,11 +590,11 @@ int Canterp::execute(const char *line) {
590590
return INTERP_ERROR;
591591
}
592592
if (!strcmp(s1, "CANON_CLOCKWISE")) {
593-
ORIENT_SPINDLE(i1, d2, CANON_CLOCKWISE);
593+
ORIENT_SPINDLE(i1, d1, CANON_CLOCKWISE);
594594
return 0;
595595
}
596596
if (!strcmp(s1, "CANON_COUNTERCLOCKWISE")) {
597-
ORIENT_SPINDLE(i1, d2, CANON_COUNTERCLOCKWISE);
597+
ORIENT_SPINDLE(i1, d1, CANON_COUNTERCLOCKWISE);
598598
return 0;
599599
}
600600
return INTERP_ERROR;

src/emc/motion/axis.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -670,15 +670,14 @@ int axis_calc_motion(double servo_period)
670670

671671
for (axis_num = 0; axis_num < EMCMOT_MAX_AXIS; axis_num++) {
672672
axis = &axis_array[axis_num];
673+
axis->teleop_vel_cmd = axis->teleop_tp.curr_vel;
674+
axis->pos_cmd = axis->teleop_tp.curr_pos;
673675
// teleop_tp.max_vel is always positive
674676
if (axis->teleop_tp.max_vel > axis->vel_limit) {
675677
axis->teleop_tp.max_vel = axis->vel_limit;
676678
}
677679
if (update_teleop_with_check(axis_num, &(axis->teleop_tp), servo_period)) {
678680
violated_teleop_limit = 1;
679-
} else {
680-
axis->teleop_vel_cmd = axis->teleop_tp.curr_vel;
681-
axis->pos_cmd = axis->teleop_tp.curr_pos;
682681
}
683682

684683
if (!axis->teleop_tp.active) {

src/emc/rs274ngc/interp_remap.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -421,11 +421,12 @@ int Interp::parse_remap(const char *inistring, int lineno)
421421
if ((s = strchr(iniline, '#')) != NULL) {
422422
*s = '\0';
423423
}
424-
s = strtok((char *) iniline, " \t");
424+
char* saveptr;
425+
s = strtok_r((char *) iniline, " \t", &saveptr);
425426

426427
while( s != NULL && argc < MAX_REMAPOPTS - 1) {
427428
argv[argc++] = s;
428-
s = strtok( NULL, " \t" );
429+
s = strtok_r( NULL, " \t", &saveptr);
429430
}
430431
if (argc == MAX_REMAPOPTS) {
431432
Error("parse_remap: too many arguments (max %d)", MAX_REMAPOPTS);

src/emc/rs274ngc/rs274ngc_pre.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -997,9 +997,9 @@ int Interp::init()
997997
for (dct=0; dct < MAX_SUB_DIRS; dct++) {
998998
_setup.subroutines[dct] = NULL;
999999
}
1000-
10011000
rtapi_strxcpy(tmpdirs,inistring->c_str());
1002-
nextdir = strtok(tmpdirs,":"); // first token
1001+
char *saveptr;
1002+
nextdir = strtok_r(tmpdirs,":",&saveptr); // first token
10031003
dct = 0;
10041004
while (1) {
10051005
char tmp_path[PATH_MAX];
@@ -1020,7 +1020,7 @@ int Interp::init()
10201020
logDebug("too many entries in SUBROUTINE_PATH, max=%d", MAX_SUB_DIRS);
10211021
break;
10221022
}
1023-
nextdir = strtok(NULL,":");
1023+
nextdir = strtok_r(NULL,":",&saveptr);
10241024
if (nextdir == NULL) break; // no more tokens
10251025
}
10261026
}

src/emc/task/emctask.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,8 @@ int emcTaskInit()
147147
}
148148
rtapi_strlcpy(tmpdirs, inistring->c_str(), sizeof(tmpdirs));
149149

150-
nextdir = strtok(tmpdirs,":"); // first token
150+
char* saveptr;
151+
nextdir = strtok_r(tmpdirs,":", &saveptr); // first token
151152
dct = 1;
152153
while (dct < MAX_M_DIRS) {
153154
if (nextdir == NULL) break; // no more tokens
@@ -157,7 +158,7 @@ int emcTaskInit()
157158
return -1;
158159
}
159160
strncpy(mdir[dct], nextdir, sizeof(mdir[dct]));
160-
nextdir = strtok(NULL,":");
161+
nextdir = strtok_r(NULL,":",&saveptr);
161162
dct++;
162163
}
163164
dmax=dct;

src/emc/tooldata/tooldata_common.cc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,15 @@ int tooldata_read_entry(const char *input_line)
9393
orientation = empty.orientation;
9494
offset = empty.offset;
9595

96-
buff = strtok(work_line, ";");
96+
char* saveptr;
97+
buff = strtok_r(work_line, ";", &saveptr);
9798
if (strlen(buff) <=1) {
9899
//fprintf(stderr,"skip blankline %s\n",__FILE__);
99100
return 0;
100101
}
101-
comment = strtok(NULL, "\n");
102+
comment = strtok_r(NULL, "\n", &saveptr);
102103

103-
token = strtok(buff, " ");
104+
token = strtok_r(buff, " ", &saveptr);
104105
while (token != NULL) {
105106
switch (toupper(token[0])) {
106107
case 'T':
@@ -188,7 +189,7 @@ int tooldata_read_entry(const char *input_line)
188189
valid = 0;
189190
break;
190191
}
191-
token = strtok(NULL, " ");
192+
token = strtok_r(NULL, " ", &saveptr);
192193
} // while token
193194

194195
if (valid) {

src/emc/tooldata/tooldata_db.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,8 @@ int tooldata_db_init(char progname_plus_args[],int random_toolchanger)
241241
if (getenv( (char*)"DB_SHOW") ) {db_show = 1;}
242242
int child_argc = 0;
243243
char* child_argv[MAX_DB_PROGRAM_ARGS] = {0};
244-
char* token = strtok(progname_plus_args, " ");
244+
char* saveptr;
245+
char* token = strtok_r(progname_plus_args, " ", &saveptr);
245246
while (token != NULL) {
246247
child_argv[child_argc] = token;
247248
child_argc++;
@@ -250,7 +251,7 @@ int tooldata_db_init(char progname_plus_args[],int random_toolchanger)
250251
,MAX_DB_PROGRAM_ARGS);
251252
return -1;
252253
}
253-
token = strtok(NULL, " ");
254+
token = strtok_r(NULL, " ", &saveptr);
254255
}
255256
snprintf(db_childname,sizeof(db_childname),"%s",child_argv[0]);
256257
is_random_toolchanger = random_toolchanger;

0 commit comments

Comments
 (0)