Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 25 additions & 25 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ jobs:
- name: Build RIP & test
run: |
set -x
sudo apt-get install -y eatmydata
sudo apt-get --yes -o Acquire::Retries=5 install eatmydata
eatmydata ./scripts/travis-install-build-deps.sh
sudo eatmydata apt --quiet --yes upgrade
sudo eatmydata apt --yes --quiet -o Acquire::Retries=5 upgrade
cd src
eatmydata ./autogen.sh
eatmydata ./configure --with-realtime=uspace --disable-check-runtime-deps
Expand All @@ -55,10 +55,10 @@ jobs:
- name: Clang build RIP & test
run: |
set -x
sudo apt-get install -y eatmydata
sudo apt-get --yes -o Acquire::Retries=5 install eatmydata
eatmydata ./scripts/travis-install-build-deps.sh
sudo eatmydata apt-get install -y clang
sudo eatmydata apt --quiet --yes upgrade
sudo eatmydata apt-get -y -o Acquire::Retries=5 install clang
sudo eatmydata apt --yes --quiet -o Acquire::Retries=5 upgrade
cd src
eatmydata ./autogen.sh
CC=clang CXX=clang++ eatmydata ./configure --with-realtime=uspace --disable-check-runtime-deps
Expand All @@ -81,8 +81,8 @@ jobs:
- name: Build HTML docmentation
run: |
./scripts/travis-install-build-deps.sh
sudo apt-get install -y eatmydata
sudo eatmydata apt --quiet --yes upgrade
sudo apt-get -y -o Acquire::Retries=5 install eatmydata
sudo eatmydata apt --yes --quiet -o Acquire::Retries=5 upgrade
cd src
eatmydata ./autogen.sh
eatmydata ./configure --with-realtime=uspace --disable-check-runtime-deps --enable-build-documentation=html
Expand Down Expand Up @@ -113,11 +113,11 @@ jobs:
run: |
set -e
set -x
apt-get --quiet update
apt-get --yes --quiet install eatmydata curl
eatmydata apt --quiet --yes upgrade
apt-get --quiet -o Acquire::Retries=5 update
apt-get --yes --quiet -o Acquire::Retries=5 install eatmydata curl
eatmydata apt --yes --quiet -o Acquire::Retries=5 upgrade
# Install stuff needed to check out the linuxcnc repo and turn it into a debian source package.
eatmydata apt-get --yes --quiet install --no-install-suggests git lsb-release python3 devscripts
eatmydata apt-get --yes --quiet -o Acquire::Retries=5 install --no-install-suggests git lsb-release python3 devscripts

- uses: actions/checkout@v3
with:
Expand All @@ -138,11 +138,11 @@ jobs:
esac
set -e
set -x
eatmydata apt-get --yes --quiet install --no-install-recommends gpg software-properties-common
eatmydata apt-get --yes --quiet -o Acquire::Retries=5 install --no-install-recommends gpg software-properties-common
eatmydata gpg --homedir="${PWD}/gnupg" --output /etc/apt/trusted.gpg.d/linuxcnc-deb-archive.gpg --export 3CB9FD148F374FEF
DIST=$(echo ${{matrix.image}} | cut -d : -f 2)
eatmydata add-apt-repository "deb http://linuxcnc.org $DIST base"
eatmydata apt-get --quiet update
eatmydata apt-get --quiet -o Acquire::Retries=5 update

- name: Build architecture-specific Debian packages
env:
Expand All @@ -157,16 +157,16 @@ jobs:
eatmydata debian/update-dch-from-git
eatmydata scripts/get-version-from-git | sed -re 's/^v(.*)$/\1/' >| VERSION; cat VERSION
eatmydata git diff
eatmydata apt-get --yes --quiet build-dep --arch-only .
eatmydata apt-get --yes --quiet -o Acquire::Retries=5 build-dep --arch-only .
eatmydata debuild -us -uc --build=any
- name: Test debian packages
env:
DEBIAN_FRONTEND: noninteractive
run: |
set -e
set -x
eatmydata apt-get --yes --quiet install ../*.deb
eatmydata apt-get --yes --quiet install sudo # some tests run sudo...
eatmydata apt-get --yes --quiet -o Acquire::Retries=5 install ../*.deb
eatmydata apt-get --yes --quiet -o Acquire::Retries=5 install sudo # some tests run sudo...
eatmydata adduser --disabled-password --gecos "" testrunner
eatmydata passwd -d testrunner
eatmydata adduser testrunner sudo
Expand Down Expand Up @@ -220,11 +220,11 @@ jobs:
run: |
set -e
set -x
apt-get --quiet update
apt-get --yes --quiet install eatmydata curl
eatmydata apt --quiet --yes upgrade
apt-get --quiet -o Acquire::Retries=5 update
apt-get --yes --quiet -o Acquire::Retries=5 install eatmydata curl
eatmydata apt --yes --quiet -o Acquire::Retries=5 upgrade
# Install stuff needed to check out the linuxcnc repo and turn it into a debian source package.
eatmydata apt-get --yes --quiet install --no-install-suggests git lsb-release python3 devscripts
eatmydata apt-get --yes --quiet -o Acquire::Retries=5 install --no-install-suggests git lsb-release python3 devscripts

- uses: actions/checkout@v3
with:
Expand All @@ -245,11 +245,11 @@ jobs:
esac
set -e
set -x
eatmydata apt-get --yes --quiet install gpg software-properties-common
eatmydata apt-get --yes --quiet -o Acquire::Retries=5 install gpg software-properties-common
eatmydata gpg --homedir="${PWD}/gnupg" --output /etc/apt/trusted.gpg.d/linuxcnc-deb-archive.gpg --export 3CB9FD148F374FEF
DIST=$(echo ${{matrix.image}} | cut -d : -f 2)
eatmydata add-apt-repository "deb http://linuxcnc.org $DIST base"
eatmydata apt-get --quiet update
eatmydata apt-get --quiet -o Acquire::Retries=5 update

- name: Build architecture-independent Debian packages
env:
Expand All @@ -264,15 +264,15 @@ jobs:
eatmydata debian/update-dch-from-git
eatmydata scripts/get-version-from-git | sed -re 's/^v(.*)$/\1/' >| VERSION; cat VERSION
eatmydata git diff
eatmydata apt-get --yes --quiet build-dep --indep-only .
eatmydata apt-get --yes --quiet -o Acquire::Retries=5 build-dep --indep-only .
eatmydata debuild -us -uc --build=all
- name: Test install debian packages
env:
DEBIAN_FRONTEND: noninteractive
run: |
set -e
set -x
eatmydata apt-get --yes --quiet install ../*.deb
eatmydata apt-get --yes --quiet -o Acquire::Retries=5 install ../*.deb
- name: Gather build artifacts
run: |
set -e
Expand Down Expand Up @@ -311,7 +311,7 @@ jobs:
run: |
set -x
git fetch --recurse-submodules=no https://github.com/linuxcnc/linuxcnc refs/tags/*:refs/tags/*
sudo apt-get -y install cppcheck shellcheck
sudo apt-get --yes -o Acquire::Retries=5 install cppcheck shellcheck
scripts/cppcheck.sh
- name: Shellcheck
continue-on-error: true
Expand Down
5 changes: 3 additions & 2 deletions src/emc/rs274ngc/interp_remap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -368,11 +368,12 @@ int Interp::parse_remap(const char *inistring, int lineno)
if ((s = strchr(iniline, '#')) != NULL) {
*s = '\0';
}
s = strtok((char *) iniline, " \t");
char* saveptr;
s = strtok_r((char *) iniline, " \t", &saveptr);

while( s != NULL && argc < MAX_REMAPOPTS - 1) {
argv[argc++] = s;
s = strtok( NULL, " \t" );
s = strtok_r( NULL, " \t", &saveptr);
}
if (argc == MAX_REMAPOPTS) {
Error("parse_remap: too many arguments (max %d)", MAX_REMAPOPTS);
Expand Down
5 changes: 3 additions & 2 deletions src/emc/rs274ngc/rs274ngc_pre.cc
Original file line number Diff line number Diff line change
Expand Up @@ -975,7 +975,8 @@ int Interp::init()
}

rtapi_strxcpy(tmpdirs,inistring);
nextdir = strtok(tmpdirs,":"); // first token
char *saveptr;
nextdir = strtok_r(tmpdirs,":",&saveptr); // first token
dct = 0;
while (1) {
char tmp_path[PATH_MAX];
Expand All @@ -996,7 +997,7 @@ int Interp::init()
logDebug("too many entries in SUBROUTINE_PATH, max=%d", MAX_SUB_DIRS);
break;
}
nextdir = strtok(NULL,":");
nextdir = strtok_r(NULL,":",&saveptr);
if (nextdir == NULL) break; // no more tokens
}
}
Expand Down
5 changes: 3 additions & 2 deletions src/emc/task/emctask.cc
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@ int emcTaskInit()
}
strncpy(tmpdirs, inistring, sizeof(tmpdirs));

nextdir = strtok(tmpdirs,":"); // first token
char* saveptr;
nextdir = strtok_r(tmpdirs,":", &saveptr); // first token
dct = 1;
while (dct < MAX_M_DIRS) {
if (nextdir == NULL) break; // no more tokens
Expand All @@ -157,7 +158,7 @@ int emcTaskInit()
return -1;
}
strncpy(mdir[dct], nextdir, sizeof(mdir[dct]));
nextdir = strtok(NULL,":");
nextdir = strtok_r(NULL,":",&saveptr);
dct++;
}
dmax=dct;
Expand Down
9 changes: 5 additions & 4 deletions src/emc/tooldata/tooldata_common.cc
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,15 @@ int tooldata_read_entry(const char *input_line,
orientation = empty.orientation;
offset = empty.offset;

buff = strtok(work_line, ";");
char* saveptr;
buff = strtok_r(work_line, ";", &saveptr);
if (strlen(buff) <=1) {
//fprintf(stderr,"skip blankline %s\n",__FILE__);
return 0;
}
comment = strtok(NULL, "\n");
comment = strtok_r(NULL, "\n", &saveptr);

token = strtok(buff, " ");
token = strtok_r(buff, " ", &saveptr);
while (token != NULL) {
switch (toupper(token[0])) {
case 'T':
Expand Down Expand Up @@ -188,7 +189,7 @@ int tooldata_read_entry(const char *input_line,
valid = 0;
break;
}
token = strtok(NULL, " ");
token = strtok_r(NULL, " ", &saveptr);
} // while token

if (valid) {
Expand Down
5 changes: 3 additions & 2 deletions src/emc/tooldata/tooldata_db.cc
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,8 @@ int tooldata_db_init(char progname_plus_args[],int random_toolchanger)
if (getenv( (char*)"DB_SHOW") ) {db_show = 1;}
int child_argc = 0;
char* child_argv[MAX_DB_PROGRAM_ARGS] = {0};
char* token = strtok(progname_plus_args, " ");
char* saveptr;
char* token = strtok_r(progname_plus_args, " ", &saveptr);
while (token != NULL) {
child_argv[child_argc] = token;
child_argc++;
Expand All @@ -251,7 +252,7 @@ int tooldata_db_init(char progname_plus_args[],int random_toolchanger)
,MAX_DB_PROGRAM_ARGS);
return -1;
}
token = strtok(NULL, " ");
token = strtok_r(NULL, " ", &saveptr);
}
snprintf(db_childname,sizeof(db_childname),"%s",child_argv[0]);
is_random_toolchanger = random_toolchanger;
Expand Down
5 changes: 3 additions & 2 deletions src/libnml/rcs/rcs_print.cc
Original file line number Diff line number Diff line change
Expand Up @@ -275,9 +275,10 @@ int separate_words(char **_dest, int _max, char *_src)
return -1;
}
rtapi_strxcpy(word_buffer, _src);
_dest[0] = strtok(word_buffer, " \n\r\t");
char* saveptr;
_dest[0] = strtok_r(word_buffer, " \n\r\t", &saveptr);
for (i = 0; NULL != _dest[i] && i < _max - 1; i++) {
_dest[i + 1] = strtok(NULL, " \n\r\t");
_dest[i + 1] = strtok_r(NULL, " \n\r\t", &saveptr);
}
if (_dest[_max - 1] == NULL && i == _max - 1) {
i--;
Expand Down
Loading