Hello community, here is the log from the commit of package schily for openSUSE:Factory checked in at 2019-06-25 22:17:20 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/schily (Old) and /work/SRC/openSUSE:Factory/.schily.new.4615 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "schily" Tue Jun 25 22:17:20 2019 rev:14 rq:711285 version:unknown Changes: -------- --- /work/SRC/openSUSE:Factory/schily/schily.changes 2019-06-04 12:09:52.679870162 +0200 +++ /work/SRC/openSUSE:Factory/.schily.new.4615/schily.changes 2019-06-25 22:17:21.664711972 +0200 @@ -1,0 +2,16 @@ +Fri Jun 14 07:18:30 UTC 2019 - Jan Engelhardt <[email protected]> + +- Update to new upstream release 2019.06.13 + * cdrecord: The manpage now lists all supported media types and + which media types are preferred over others. + * star 1.6.1: fixed a bug in the FIFO code where star reported "star: + Implementation botch: with FIFO_MEOF" as the tar side of the + FIFO did sometimes not wait for the FIFO_IWAIT state when + called as "star -multivolume -tv f=... f=... ..." + * bsh: When expanding file names, the directory entries "." and + ".." are now skipped and not part of the results. This is to + make bsh to behave similar to the Bourne Shell with respect + to globbing. + +------------------------------------------------------------------- + Old: ---- schily-2019-05-28.tar.bz2 New: ---- schily-2019-06-13.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ schily.spec ++++++ --- /var/tmp/diff_new_pack.4WPiOs/_old 2019-06-25 22:17:22.252712878 +0200 +++ /var/tmp/diff_new_pack.4WPiOs/_new 2019-06-25 22:17:22.264712896 +0200 @@ -17,14 +17,14 @@ # grep -r define.VERSION (sometimes also noted down in schily-%rver/AN-%rver) -%global box_version 2019.05.28 +%global box_version 2019.06.13 %global cdr_version 3.02~a10 %global sccs_version 5.09 %global smake_version 1.3 -%global star_version 1.6 +%global star_version 1.6.1 %global libfind_version 1.7 %global ved_version 1.7 -%define rver 2019-05-28 +%define rver 2019-06-13 Name: schily Version: %box_version ++++++ schily-2019-05-28.tar.bz2 -> schily-2019-06-13.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/schily-2019-05-28/AN-2019-06-13 new/schily-2019-06-13/AN-2019-06-13 --- old/schily-2019-05-28/AN-2019-06-13 1970-01-01 01:00:00.000000000 +0100 +++ new/schily-2019-06-13/AN-2019-06-13 2019-06-13 14:15:36.000000000 +0200 @@ -0,0 +1,232 @@ +New features with AN-2019-06-13: + +This is the first localization step for the schily source consolidation. Many +programs now (hopefully) call gettext() for all strings that need localization. + +- The next step will include dgettext() calls for the libraries and the + missing programs + +- The following step will include the extracted strings + +- The last step will include German translations and install support + for the resulting binary message object files. + +----------> Please test and report compilation problems! <--------- + +***** NOTE: As mentioned since 2004, frontends to the tools should ***** +***** call all programs in the "C" locale ***** +***** by e.g. calling: LC_ALL=C cdrecord .... ***** +***** unless these frontends support localized strings ***** +***** used by the cdrtools with NLS support. ***** + + *** WARNING *** + *** Need new smake *** + + *** Due to the fact that schily-tools 2014-04-03 introduced to use new macro + *** expansions and a related bug fix in smake, you need a new smake + *** to compile this source. If your smake is too old and aborts, ensure this + *** by calling: + + cd ./psmake + ./MAKE-all + cd .. + psmake/smake + psmake/smake install + + The new smake version mentioned above is smake-1.2.4 + The recent smake version is smake-1.3 + + *** Due to the fact that schily-tools 2014-01-26 introduced + *** optimizations for the Schily version of SunPro Make, you + *** need at least the dmake version from 2018/01/11 with support + *** for the "export" directive to compile with this makefile system. + + + WARNING: the new version of the isoinfo program makes use of the + *at() series of functions that have been introduced by Sun + in August 2001 and added to POSIX.1-2008. For older platforms, + libschily now includes emulations for these functions but + these emulations have not yet been tested thoroughly. + Please report problems! + + BUG WARNING: Please never report bugs to Linux distributions as they + usually do not forward these bug reports upstream and as the + Linux distributions typically do not let skilled people check + the bugs. We did not hear about a FIFO problem in star for a + long time and since the problem that (on Linux) occurred once + every 6000-10000 tries did not happen on Solaris after + 10 million tries, it was not known otherwise. + +- cal: The code now correctly deals with a switch date that affects + December and January. This allows to verify switch dates that become + effective with January 1st and need to have all skipped days in + December. + +- cdrecord: The man page now lists all supported media types and which + media types are preferred over others. This is aimed to tell people + to use DVD+R/DL instead of DVD-R/DL, while using DVD-R and DVD-RW + in favor of DVD+R... + +- patch: #ifdef HAVE_RENAME has been removed. We now use the rename() + emulation from libschily in case rename() does not exists on a specific + platform. + +- star: fixed a bug in the FIFO code that mainly happened on Linux (with + a 1000x higher probability than it happens on Solaris). The bug was + caused, as a check for a flag has been done twice instead of only once + where it could change it's value between both locations. As a + result, star reported "star: Implementation botch: with FIFO_MEOF" + as the tar side of the FIFO did sometimes not wait for the FIFO_IWAIT + state when called as "star -multivolume -tv f=... f=... ... + For this reason, star incorrectly got a wakeup at the wrong location. + + The bug appeared in case that star -x/-t -multivol f=.. f=.. .... + has been called with very small tar archives. + + Thanks to Heiko Ei�feldt for reporting. + +- star: The FIFO code renamed the "flag" member of the "m_head" structure + to "gflag" for better readability. + +- star: The debugging code in the FIFO has been enhanced to print the + names of the flag bits in addition to the hex values. + +- star: A deadlock situation that happens once every 500000 tries on + Linux with multi-volume archives has been fixed. + + The problem was caused by a complex condition where the get side + of the FIFO needs to check the EOF FIFO flag and the amount of data + available in the FIFO and then decide whether to wait for a wakeup or + not. + + Since the EOF flag needs to be checked first, a context switch in + the get side of the FIFO could allow the put side to set the EOF flag + before the get side did check the fill ratio of the FIFO. This + caused both the get side and the put side to wait for a wakeup. + + The new code introduced a new variable mp->mayoblock that is set by + the get side before checking for EOF. This new flags allows the + put side to know that the get side is just in a critical situation + and lets the put side wait until mp->mayoblock is no longer set, + which signals a stable state in the get side. This permits to + avoid the deadlock. + +- star: Note that the FIFO has been initially written as a lock free + design in the late 1980's. This is to allow high portability to even + older UNIX versions. The star FIFO works on all UNIX variants that + support pipes and shared memory, which is e.g. the case for + SunOS-4.0 from 1988. At the time the FIFO has been designed, the + target OS did not support multi-CPU systems and problems in the + FIFO first appeared with massively faster multi-CPU systems around + y2000. The recently detected problems all have been triggered by a + different context switch behavior on Linux, even though they could + have appeared on any OS in case that many million tries are + attempted. + +- star: bumped version to 1.6.1 + +- Bourne Shell: A new option "set -o globskipdot" has been added. + If set, the entries "." and ".." are skipped and not shown in globbing + results. If not set, the entries "." and ".." are always returned, + even when they are not part of the readdir(3) results. + +- Bourne Shell: The option "set -o globskipdot" has been made the + new dfault behavior for "bosh", but not for "pbosh" + + Note that this new shell option has been introduced as a result + of a related BUG discussion in the Austin Group telephone conference. + The background is to permit shell scripts to check whether a shell + grants to hide the "." and ".." for all filesystems. + +- bsh: When expanding file names, the directory entries . and .. + are now skipped and not part of the results. This is to make bsh + to behave similar to the Bourne Shell with respect to globbing. + + +- SCCS TODO: + + - Convert sccs.c to use -NSCCS in the back end programs instead + of converting g-file names from the command line into s.file + names in the frontend in order to forward s.file names to the + backend programs. Doing it this way allows us to have the SCCS + history files "off tree" in a separate directory tree starting + with ".sccs/" at the "project root" directory, as the related + code to convert path names is in libcomobj::bulkprepare(). + + - Add code to admin(1) and delta(1) to retrieve the list of + new or modified files in order to have all important code + for a "sccs commit" in a single program that does not need to + deal with ARG_MAX limitations. + + - Add code to admin(1), delta(1) and get(1) to maintain/understand + the changeset file. + + - Add code to libcomobj to understand the changeset file, + which is needed in order to e.g. know the file names and file + specific SIDs/state that correspond to a project global SID. + + - Add code to all programs to maintain a lock (for the file + $PROJECTHOME/.sccs/SCCS/s.changeset, that would be in the file + $PROJECTHOME/.sccs/SCCS/z.changeset) to maintain a project + global lock. + + - Find/verify a complete transactional model that allows to repair + complex changes to the set of files for a project that have + been aborted in the middle. The current idea is to create the + file $PROJECTHOME/.sccs/changeset with the deltas to the + changeset during a complex update operation. + + - Find a way to decide when to use SCCS v6 type history files. + For the project mode, this is needed in order to prevent + historic SCCS implementations to believe they could modify + files without knowing about project global locks. + + + + + +- Bourne Shell Missing features for POSIX compliance: + + - Support for $'...' quoting (this is not needed for the current + version of POSIX but for the next POSIX + version that will be named SUSv8). + The development of SUSv8 will start in + late 2016. + + We are now expecting the Bourne Shell to be fully POSIX compliant. + +- Bourne Shell further TODO list: + + - Finish loadable builtin support. + + - POSIX does not allow us to implement ". -h", so we will + add a "source" builtin to be able to implement "source -h" + +- The following builtins (that are available in bsh) are still missing in + the Bourne Shell: + + err echo with output going to stderr + glob echo with '\0' instead of ' ' between args + env a builtin version of /usr/bin/env + + The following bsh intrinsics are still missing in the Bourne Shell: + + - the restricted bsh has restriction features that + are missing in the Bourne shell. + + - source -h read file into history but do not execute + + and probably more features not yet identified to be bsh unique. + + + +Author: + +Joerg Schilling +Seestr. 110 +D-13353 Berlin +Germany + +Email: [email protected], [email protected] + +Please mail bugs and suggestions to me. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/schily-2019-05-28/bsh/expand.c new/schily-2019-06-13/bsh/expand.c --- old/schily-2019-05-28/bsh/expand.c 2019-04-07 18:55:39.000000000 +0200 +++ new/schily-2019-06-13/bsh/expand.c 2019-06-12 22:38:23.000000000 +0200 @@ -1,8 +1,8 @@ -/* @(#)expand.c 1.56 19/04/07 Copyright 1985-2019 J. Schilling */ +/* @(#)expand.c 1.57 19/06/12 Copyright 1985-2019 J. Schilling */ #include <schily/mconfig.h> #ifndef lint static UConst char sccsid[] = - "@(#)expand.c 1.56 19/04/07 Copyright 1985-2019 J. Schilling"; + "@(#)expand.c 1.57 19/06/12 Copyright 1985-2019 J. Schilling"; #endif /* * Expand a pattern (do shell name globbing) @@ -361,28 +361,35 @@ } else while ((dent = readdir(dirp)) != 0 && !ctlc) { int namlen; + char *name = dent->d_name; + + /* + * Skip the following names: "", ".", "..". + */ + if (name[name[0] != '.' ? 0 : name[1] != '.' ? 1 : 2] == '\0') + continue; /* * Are we interested in files starting with '.'? */ - if (dent->d_name[0] == '.' && *dp != '.') + if (name[0] == '.' && *dp != '.') continue; namlen = DIR_NAMELEN(dent); if (patm) { tmp = (char *)patmatch((unsigned char *)dp, aux, - (unsigned char *)dent->d_name, 0, namlen, + (unsigned char *)name, 0, namlen, alt, state); } else { - if (strstr(dent->d_name, dp) == dent->d_name) + if (strstr(name, dp) == name) tmp = ""; else tmp = NULL; } #ifdef DEBUG - if (tmp != NULL || (dent->d_name[0] == dp[0] && + if (tmp != NULL || (name[0] == dp[0] && patlen == namlen)) - EDEBUG(("match? '%s' end: '%s'\n", dent->d_name, tmp)); + EDEBUG(("match? '%s' end: '%s'\n", name, tmp)); #endif /* * *tmp == '\0' is a result of an exact pattern match. @@ -396,11 +403,11 @@ if ((tmp != NULL && *tmp == '\0') || (patlen == namlen && - dent->d_name[0] == dp[0] && - dncmp(dent->d_name, dp) == 0)) { - EDEBUG(("found: '%s'\n", dent->d_name)); + name[0] == dp[0] && + dncmp(name, dp) == 0)) { + EDEBUG(("found: '%s'\n", name)); - cname = concat(dir, dent->d_name, cp, (char *)NULL); + cname = concat(dir, name, cp, (char *)NULL); if (*cp == '/') { EDEBUG(("rescan: '%s'\n", cname)); rescan++; @@ -410,7 +417,7 @@ (Tnode *)cname, l1); } else { EDEBUG(("cannot concat: '%s%s%s'\n", - /* EDEBUG */ dir, dent->d_name, cp)); + /* EDEBUG */ dir, name, cp)); break; } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/schily-2019-05-28/cal/cal.c new/schily-2019-06-13/cal/cal.c --- old/schily-2019-05-28/cal/cal.c 2019-05-27 20:49:37.000000000 +0200 +++ new/schily-2019-06-13/cal/cal.c 2019-05-30 13:52:29.000000000 +0200 @@ -30,7 +30,7 @@ /* * Copyright 2019 J. Schilling * - * @(#)cal.c 1.4 19/05/27 J. Schilling + * @(#)cal.c 1.5 19/05/30 J. Schilling * * From @(#)cal.c 1.14 05/06/08 SMI */ @@ -351,8 +351,8 @@ } if (y == yg) { /* - * If we are in year that is a Julian leap year but not in the - * Gregorian calendar, we need to use a non-leap February, + * If we are in a year that is a Julian leap year but not in + * the Gregorian calendar, we need to use a non-leap February, * if the calendar switch is active already at the end of * February or if the skipped days include the leap day. */ @@ -365,13 +365,21 @@ int l = mon[mg]; mon[mg] = dg-1; - skip = sg - l + mon[mg]; + skip = sg - l + mon[mg]; } + } else if (((y-1) == yg) && (mg == 12) && (dg+sg) > 32) { + /* + * Compute the number of days to skip in January. + */ + skip = (dg+sg) - 32; } for (i = 1; i < m; i++) d += mon[i]; - if (y == yg && m > (mg+1)) /* Need tp correct wday if skipped */ - d -= skip; /* days span two months */ + if (y == yg && m > (mg+1)) /* Correct wday a month after next */ + d -= skip; /* if skipped days span two months */ + else if (((y-1) == yg) && m == 1) /* January after switch year and */ + d += skip; /* skipped days span year start */ + d %= 7; s += 3*d; for (i = 1; i <= mon[m]; i++) { @@ -382,6 +390,10 @@ } if (i == 1 && m == (mg+1)) i += skip; + } else if (((y-1) == yg) && m == 1) { + if (i == 1) + i += skip; + } if (i > 9) *s = i/10+'0'; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/schily-2019-05-28/cdrecord/cdrecord.1 new/schily-2019-06-13/cdrecord/cdrecord.1 --- old/schily-2019-05-28/cdrecord/cdrecord.1 2018-11-08 20:55:08.000000000 +0100 +++ new/schily-2019-06-13/cdrecord/cdrecord.1 2019-06-12 22:41:57.000000000 +0200 @@ -1,4 +1,4 @@ -.\" @(#)cdrecord.1 1.156 18/11/08 Copyright 1996-2018 J. Schilling +.\" @(#)cdrecord.1 1.157 19/06/12 Copyright 1996-2018 J. Schilling .\" .\" The contents of this file are subject to the terms of the .\" Common Development and Distribution License, Version 1.0 only @@ -26,7 +26,7 @@ .if n .ds s sz .if t .ds m \\(*m .if n .ds m micro -.TH CDRECORD 1 "Version 3.02 2018/11/08" "J\*org Schilling" "Schily\'s USER COMMANDS" +.TH CDRECORD 1 "Version 3.02 2019/06/12" "J\*org Schilling" "Schily\'s USER COMMANDS" .SH NAME cdrecord \- record audio or data CD, DVD or BluRay .SH SYNOPSIS @@ -46,6 +46,54 @@ CD-recorder, to write DVD media on a DVD-recorder or to write BluRay media on a BluRay-recorder. .PP +.SS "Supported Media" +.B Cdrecord +supports to write the following media types: +.TP 10 +.B CD-R +.BR "CD recordable" , +a write once CD medium. +.TP +.B CD-RW +.BR "CD read/write" , +a rewritable once CD medium. +.TP +.B DVD-R +.BR "DVD recordable" , +a write once DVD medium. +This is the preferred single layer write once DVD medium type. +.TP +.B DVD-RW +.BR "DVD read/write" , +a rewritable DVD medium. +This is the preferred single layer rewritable DVD medium type. +.TP +.B DVD+R +.BR "DVDplus recordable" , +a write once DVDplus medium. +.TP +.B DVD+RW +.BR "DVDplus read/write" , +a rewritable DVDplus medium. +.TP +.B DVD-R/DL +.B DVD Dual layer +.TP +.B DVD+R/DL +.B DVD Double layer +This is the preferred dual layer DVD medium type +as DVD+R/DL works on most writers and on almost all readers. +.TP +.B BD-R +.B Blu-Ray recordable +a write once Blu-Ray medium. +This includes multi layer support. +.TP +.B BD-RE +.B Blu-Ray rewritable +a rewritable Blu-Ray medium. +This includes multi layer support. +.PP .SS "Device naming" Most users do not need to care about device naming at all. If no diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/schily-2019-05-28/obosh/Makefile new/schily-2019-06-13/obosh/Makefile --- old/schily-2019-05-28/obosh/Makefile 2019-05-19 12:58:09.000000000 +0200 +++ new/schily-2019-06-13/obosh/Makefile 2019-06-11 22:01:53.000000000 +0200 @@ -1,4 +1,4 @@ -#ident "@(#)Makefile 1.99 19/05/19 Copyright (c) 2006-2018 J. Schilling" +#ident "@(#)Makefile 1.101 19/06/11 Copyright (c) 2006-2018 J. Schilling" ########################################################################### SRCROOT= .. RULESDIR= RULES @@ -67,6 +67,8 @@ #CPPOPTS += -DDO_ALLEXPORT # Bugfix for set -a; read VAR / getopts #CPPOPTS += -DDO_O_APPEND # Support O_APPEND instead of lseek() for >> #CPPOPTS += -DDO_EXPAND_DIRSLASH # Expand dir*/ to dir/ +#CPPOPTS += -DDO_GLOBSKIPDOT # Implement set -o globskipdot, skip . .. +#CPPOPTS += -DDO_GLOBSKIPDOT_DEF # Implement set -o globskipdot as default #CPPOPTS += -DDO_SIGNED_EXIT # Allow negative exit(1) parameters #CPPOPTS += -DDO_DOT_SH_PARAMS # Include support for ${.sh.xxx} parameters #CPPOPTS += -DDO_U_DOLAT_NOFAIL # set -u; echo "$@" does not fail diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/schily-2019-05-28/patch/util.c new/schily-2019-06-13/patch/util.c --- old/schily-2019-05-28/patch/util.c 2018-02-28 22:24:33.000000000 +0100 +++ new/schily-2019-06-13/patch/util.c 2019-06-12 23:53:27.000000000 +0200 @@ -1,12 +1,12 @@ -/* @(#)util.c 1.38 18/02/28 2011-2018 J. Schilling */ +/* @(#)util.c 1.39 19/06/12 2011-2019 J. Schilling */ #include <schily/mconfig.h> #ifndef lint static UConst char sccsid[] = - "@(#)util.c 1.38 18/02/28 2011-2018 J. Schilling"; + "@(#)util.c 1.39 19/06/12 2011-2019 J. Schilling"; #endif /* * Copyright (c) 1986 Larry Wall - * Copyright (c) 2011-2018 J. Schilling + * Copyright (c) 2011-2019 J. Schilling * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following condition is met: @@ -127,23 +127,11 @@ if (debug & 4) say(_("Moving %s to %s.\n"), to, bakname); #endif -#ifdef HAVE_RENAME if (rename(to, bakname) < 0) { say(_("patch: can't backup %s, output is in %s\n"), to, from); return (-1); } -#else - if (link(to, bakname) < 0) { - say(_("patch: can't backup %s, output is in %s\n"), - to, from); - return (-1); - } - while (unlink(to) >= 0) { - ; - /* LINTED */ - } -#endif } backup_done: if (from == NULL) { @@ -159,11 +147,7 @@ if (debug & 4) say(_("Moving %s to %s.\n"), from, to); #endif -#ifdef HAVE_RENAME if (rename(from, to) < 0) { /* different file system? */ -#else - if (link(from, to) < 0) { /* different file system? */ -#endif int tofd; tofd = creat(to, 0666); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/schily-2019-05-28/pbosh/Makefile new/schily-2019-06-13/pbosh/Makefile --- old/schily-2019-05-28/pbosh/Makefile 2019-05-19 12:58:09.000000000 +0200 +++ new/schily-2019-06-13/pbosh/Makefile 2019-06-11 22:01:56.000000000 +0200 @@ -1,4 +1,4 @@ -#ident "@(#)Makefile 1.156 19/05/19 Copyright (c) 2006-2018 J. Schilling" +#ident "@(#)Makefile 1.158 19/06/11 Copyright (c) 2006-2018 J. Schilling" ########################################################################### SRCROOT= .. RULESDIR= RULES @@ -68,6 +68,8 @@ CPPOPTS += -DDO_ALLEXPORT # Bugfix for set -a; read VAR / getopts CPPOPTS += -DDO_O_APPEND # Support O_APPEND instead of lseek() for >> CPPOPTS += -DDO_EXPAND_DIRSLASH # Expand dir*/ to dir/ +CPPOPTS += -DDO_GLOBSKIPDOT # Implement set -o globskipdot, skip . .. +#CPPOPTS += -DDO_GLOBSKIPDOT_DEF # Implement set -o globskipdot as default CPPOPTS += -DDO_SIGNED_EXIT # Allow negative exit(1) parameters CPPOPTS += -DDO_DOT_SH_PARAMS # Include support for ${.sh.xxx} parameters CPPOPTS += -DDO_U_DOLAT_NOFAIL # set -u; echo "$@" does not fail diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/schily-2019-05-28/sh/Makefile new/schily-2019-06-13/sh/Makefile --- old/schily-2019-05-28/sh/Makefile 2019-05-19 12:58:09.000000000 +0200 +++ new/schily-2019-06-13/sh/Makefile 2019-06-11 22:01:48.000000000 +0200 @@ -1,4 +1,4 @@ -#ident "@(#)Makefile 1.153 19/05/19 Copyright (c) 2006-2018 J. Schilling" +#ident "@(#)Makefile 1.155 19/06/11 Copyright (c) 2006-2018 J. Schilling" ########################################################################### SRCROOT= .. RULESDIR= RULES @@ -68,6 +68,8 @@ CPPOPTS += -DDO_ALLEXPORT # Bugfix for set -a; read VAR / getopts CPPOPTS += -DDO_O_APPEND # Support O_APPEND instead of lseek() for >> CPPOPTS += -DDO_EXPAND_DIRSLASH # Expand dir*/ to dir/ +CPPOPTS += -DDO_GLOBSKIPDOT # Implement set -o globskipdot, skip . .. +CPPOPTS += -DDO_GLOBSKIPDOT_DEF # Implement set -o globskipdot as default CPPOPTS += -DDO_SIGNED_EXIT # Allow negative exit(1) parameters CPPOPTS += -DDO_DOT_SH_PARAMS # Include support for ${.sh.xxx} parameters CPPOPTS += -DDO_U_DOLAT_NOFAIL # set -u; echo "$@" does not fail diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/schily-2019-05-28/sh/args.c new/schily-2019-06-13/sh/args.c --- old/schily-2019-05-28/sh/args.c 2019-01-09 23:34:58.000000000 +0100 +++ new/schily-2019-06-13/sh/args.c 2019-06-10 16:28:13.000000000 +0200 @@ -41,11 +41,11 @@ /* * Copyright 2008-2019 J. Schilling * - * @(#)args.c 1.91 19/01/09 2008-2019 J. Schilling + * @(#)args.c 1.92 19/06/10 2008-2019 J. Schilling */ #ifndef lint static UConst char sccsid[] = - "@(#)args.c 1.91 19/01/09 2008-2019 J. Schilling"; + "@(#)args.c 1.92 19/06/10 2008-2019 J. Schilling"; #endif /* @@ -111,11 +111,14 @@ 0, /* set -o fdpipe */ #endif #ifdef DO_FULLEXCODE - 0, /* set -o fullexcode */ + 0, /* set -o fullexitcode */ #endif #if defined(DO_SYSALIAS) && defined(DO_GLOBALALIASES) 0, /* set -o globalaliases */ #endif +#ifdef DO_GLOBSKIPDOT + 0, /* set -o globskipdot */ +#endif 'h', #ifdef DO_HASHCMDS 0, /* -o hashcmds, enable # commands */ @@ -189,6 +192,9 @@ #if defined(DO_SYSALIAS) && defined(DO_GLOBALALIASES) "globalaliases", #endif +#ifdef DO_GLOBSKIPDOT + "globskipdot", +#endif "hashall", /* -h bash name (ksh93 uses "trackall") */ #ifdef DO_HASHCMDS "hashcmds", /* -o hashcmds, enable # commands */ @@ -261,6 +267,9 @@ #if defined(DO_SYSALIAS) && defined(DO_GLOBALALIASES) fl2 | globalaliasflg, /* -o globalaliases */ #endif +#ifdef DO_GLOBSKIPDOT + fl2 | globskipdot, /* -o globskipdot */ +#endif hashflg, /* -h / -o hashall */ #ifdef DO_HASHCMDS fl2 | hashcmdsflg, /* -o hashcmds, enable # commands */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/schily-2019-05-28/sh/defs.h new/schily-2019-06-13/sh/defs.h --- old/schily-2019-05-28/sh/defs.h 2019-05-19 12:58:09.000000000 +0200 +++ new/schily-2019-06-13/sh/defs.h 2019-06-10 16:28:13.000000000 +0200 @@ -39,7 +39,7 @@ /* * Copyright 2008-2019 J. Schilling * - * @(#)defs.h 1.201 19/05/19 2008-2019 J. Schilling + * @(#)defs.h 1.202 19/06/10 2008-2019 J. Schilling */ /* @@ -1225,6 +1225,7 @@ #define vedflg 0100000 /* set -o ved VED cmdln. edit */ #define posixflg 0200000 /* set -o posix */ #define promptcmdsubst 0400000 /* set -o promptcmdsubst */ +#define globskipdot 01000000 /* set -o globskipdot */ extern unsigned long flags; /* Flags for set(1) and more */ extern unsigned long flags2; /* Second set of flags */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/schily-2019-05-28/sh/expand.c new/schily-2019-06-13/sh/expand.c --- old/schily-2019-05-28/sh/expand.c 2019-01-13 18:38:47.000000000 +0100 +++ new/schily-2019-06-13/sh/expand.c 2019-06-10 16:28:13.000000000 +0200 @@ -36,11 +36,11 @@ /* * Copyright 2008-2019 J. Schilling * - * @(#)expand.c 1.27 19/01/13 2008-2019 J. Schilling + * @(#)expand.c 1.28 19/06/10 2008-2019 J. Schilling */ #ifndef lint static UConst char sccsid[] = - "@(#)expand.c 1.27 19/01/13 2008-2019 J. Schilling"; + "@(#)expand.c 1.28 19/06/10 2008-2019 J. Schilling"; #endif /* @@ -72,6 +72,10 @@ void makearg __PR((struct argnod *)); static DIR *lopendir __PR((char *name)); +#ifdef DO_GLOBSKIPDOT +static char *dots[] = { ".", ".." }; +#endif + int expand(as, rcnt) unsigned char *as; @@ -208,16 +212,41 @@ count++; } else #endif + { +#ifdef DO_GLOBSKIPDOT + if ((flags2 & globskipdot) == 0 && *cs == '.') { + /* + * Synthesize "." and ".." to make sure they are present + * even if the current filesystem does not have them. + */ + for (len = 0; len < 2; len++) { + if (gmatch(dots[len], (char *)cs)) { + addg(s, (unsigned char *)dots[len], + rescan, slashsav); + count++; + } + } + } +#endif while ((e = readdir(dirf)) != 0 && (trapnote & SIGSET) == 0) { - if (e->d_name[0] == '.' && *cs != '.') + char *name = e->d_name; + +#ifdef DO_GLOBSKIPDOT + /* + * Skip the following names: "", ".", "..". + */ + if (name[name[0] != '.' ? 0 : name[1] != '.' ? 1 : 2] == '\0') + continue; +#endif + if (name[0] == '.' && *cs != '.') continue; - if (gmatch(e->d_name, (char *)cs)) { - addg(s, (unsigned char *)e->d_name, rescan, + if (gmatch(name, (char *)cs)) { + addg(s, (unsigned char *)name, rescan, slashsav); count++; } - } + }} (void) closedir(dirf); if (rescan) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/schily-2019-05-28/sh/main.c new/schily-2019-06-13/sh/main.c --- old/schily-2019-05-28/sh/main.c 2019-05-19 12:58:09.000000000 +0200 +++ new/schily-2019-06-13/sh/main.c 2019-06-11 22:02:00.000000000 +0200 @@ -38,11 +38,11 @@ /* * Copyright 2008-2019 J. Schilling * - * @(#)main.c 1.76 19/05/19 2008-2019 J. Schilling + * @(#)main.c 1.77 19/06/11 2008-2019 J. Schilling */ #ifndef lint static UConst char sccsid[] = - "@(#)main.c 1.76 19/05/19 2008-2019 J. Schilling"; + "@(#)main.c 1.77 19/06/11 2008-2019 J. Schilling"; #endif /* @@ -254,6 +254,9 @@ eq("-jbosh", simple((unsigned char *)*v))) flags |= monitorflg; +#ifdef DO_GLOBSKIPDOT_DEF + flags2 |= globskipdot; +#endif #ifdef DO_ALWAYS_POSIX_SH flags2 |= posixflg; #else @@ -383,6 +386,9 @@ #endif flags |= subsh; flags2 |= posix; /* restore "auto-posix" value */ +#ifdef DO_GLOBSKIPDOT_DEF + flags2 |= globskipdot; +#endif mypgid = getpgid(0); /* get process group of script */ } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/schily-2019-05-28/sh/sh.1 new/schily-2019-06-13/sh/sh.1 --- old/schily-2019-05-28/sh/sh.1 2019-04-18 00:11:27.000000000 +0200 +++ new/schily-2019-06-13/sh/sh.1 2019-06-11 22:24:44.000000000 +0200 @@ -1,5 +1,5 @@ '\" te -.\" @(#)sh.1 1.241 19/04/18 Copyright 2012-2019 J. Schilling +.\" @(#)sh.1 1.244 19/06/11 Copyright 2012-2019 J. Schilling .\" Copyright 1989 AT&T .\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved. .\" Portions Copyright (c) 1992, X/Open Company Limited All Rights Reserved @@ -59,7 +59,7 @@ .if n .ds o oe .if n .ds u ue .if n .ds s sz -.TH sh 1 "2019/04/18" "Schily Bourne Shell" "User Commands" +.TH sh 1 "2019/06/11" "Schily Bourne Shell" "User Commands" .SH NAME sh, bosh, jsh \- standard and job control shell and command interpreter .SH SYNOPSIS @@ -5763,6 +5763,27 @@ .BR on , the persistent global aliases are loaded. .TP +.B globskipdot +If set, the entries +.B +"." +and +.B +".." +are skipped and not shown in globbing results. +If not set, the entries +.B +"." +and +.B +".." +are always returned, even when they are not part of the +.BR readdir (3) +results. +The shell flag +.B globskipdot +is enabled by default. +.TP .B hashall Equivalent to .BR \-h . diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/schily-2019-05-28/sh/version.h new/schily-2019-06-13/sh/version.h --- old/schily-2019-05-28/sh/version.h 2019-04-17 01:36:13.000000000 +0200 +++ new/schily-2019-06-13/sh/version.h 2019-06-10 16:33:16.000000000 +0200 @@ -1,4 +1,4 @@ -/* @(#)version.h 1.80 19/04/17 Copyright 2012-2019 J. Schilling */ +/* @(#)version.h 1.81 19/06/10 Copyright 2012-2019 J. Schilling */ /* * The version for the Bourne Shell @@ -17,5 +17,5 @@ * file and include the License file CDDL.Schily.txt from this distribution. */ -#define VERSION_DATE "2019/04/17" +#define VERSION_DATE "2019/06/10" #define VERSION_STR "a+" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/schily-2019-05-28/sh/xec.c new/schily-2019-06-13/sh/xec.c --- old/schily-2019-05-28/sh/xec.c 2019-04-17 01:13:17.000000000 +0200 +++ new/schily-2019-06-13/sh/xec.c 2019-06-12 01:03:12.000000000 +0200 @@ -38,11 +38,11 @@ /* * Copyright 2008-2019 J. Schilling * - * @(#)xec.c 1.109 19/04/17 2008-2019 J. Schilling + * @(#)xec.c 1.110 19/06/12 2008-2019 J. Schilling */ #ifndef lint static UConst char sccsid[] = - "@(#)xec.c 1.109 19/04/17 2008-2019 J. Schilling"; + "@(#)xec.c 1.110 19/06/12 2008-2019 J. Schilling"; #endif /* @@ -982,7 +982,8 @@ case TLST: /* ";" separated command list */ execute(lstptr(t)->lstlef, - xflags&XEC_NOSTOP, errorflg, + xflags&XEC_NOSTOP, + errorflg, no_pipe, no_pipe); /* * When not in POSIX mode, be compatible to the Solaris @@ -992,10 +993,11 @@ * Update errorflg if set -e is invoked in the sub-sh */ execute(lstptr(t)->lstrit, + xflags, #ifdef DO_POSIX_E - xflags, errorflg, + errorflg, #else - xflags, (errorflg | (eflag & errflg)), + (errorflg | (eflag & errflg)), #endif no_pipe, no_pipe); break; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/schily-2019-05-28/star/fifo.c new/schily-2019-06-13/star/fifo.c --- old/schily-2019-05-28/star/fifo.c 2019-03-02 00:44:57.000000000 +0100 +++ new/schily-2019-06-13/star/fifo.c 2019-06-09 14:13:05.000000000 +0200 @@ -1,8 +1,8 @@ -/* @(#)fifo.c 1.100 19/03/02 Copyright 1989, 1994-2019 J. Schilling */ +/* @(#)fifo.c 1.104 19/06/09 Copyright 1989, 1994-2019 J. Schilling */ #include <schily/mconfig.h> #ifndef lint static UConst char sccsid[] = - "@(#)fifo.c 1.100 19/03/02 Copyright 1989, 1994-2019 J. Schilling"; + "@(#)fifo.c 1.104 19/06/09 Copyright 1989, 1994-2019 J. Schilling"; #endif /* * A "fifo" that uses shared memory between two processes @@ -103,6 +103,9 @@ #else #define EDEBUG(a) #endif +#ifdef HANG_DEBUG +#include <schily/string.h> +#endif /* * roundup(x, y), x needs to be unsigned or x+y non-negative. @@ -138,12 +141,17 @@ int hiw; int low; -LOCAL int waitchan; +LOCAL int waitchan; /* Current waiting channel for debugging */ EXPORT void initfifo __PR((void)); LOCAL void fifo_setparams __PR((void)); EXPORT void fifo_ibs_shrink __PR((int newsize)); EXPORT void runfifo __PR((int ac, char *const *av)); +#ifdef HANG_DEBUG +LOCAL char *prgflags __PR((int f, char *fbuf)); +LOCAL char *preflags __PR((int f, char *fbuf)); +LOCAL char *prpflags __PR((int f, char *fbuf)); +#endif EXPORT void fifo_prmp __PR((int sig)); EXPORT void fifo_stats __PR((void)); LOCAL int swait __PR((int f, int chan)); @@ -281,6 +289,7 @@ mp->base = &buf[addsize]; mp->iblocked = FALSE; mp->oblocked = FALSE; + mp->mayoblock = FALSE; /* * Note that R'est'size is used to store shareable strings from the * 'g'lobal P-1.2001 headers. @@ -320,7 +329,7 @@ #endif mp->putptr = mp->getptr = mp->base; - fifo_prmp(0); + fifo_prmp(0); /* Print FIFO information with -debug */ { /* Temporary until all modules know about mp->xxx */ extern int bufsize; @@ -446,7 +455,7 @@ /* * Tape -> FIFO (Put side) */ - mp->flags |= FIFO_IWAIT; + mp->gflags |= FIFO_IWAIT; mp->ibs = bs; mp->obs = mp->size; do_in(); /* Extract mode: read archive in bg. */ @@ -473,11 +482,89 @@ } } +#ifdef HANG_DEBUG +LOCAL char * +prgflags(f, fbuf) + int f; + char *fbuf; +{ + char *p = fbuf; + + *p = '\0'; + if (f) + *p++ = '\t'; + + if (f & FIFO_MERROR) { + strcpy(p, "FIFO_MERROR"); + p += 11; + } + if (f & FIFO_IWAIT) { + if (p > &fbuf[1]) + *p++ = '|'; + strcpy(p, "FIFO_IWAIT"); + p += 10; + } + if (f & FIFO_I_CHREEL) { + if (p > &fbuf[1]) + *p++ = '|'; + strcpy(p, "FIFO_I_CHREEL"); + } + return (fbuf); +} + +LOCAL char * +preflags(f, fbuf) + int f; + char *fbuf; +{ + char *p = fbuf; + + *p = '\0'; + if (f) + *p++ = '\t'; + + if (f & FIFO_EXIT) { + strcpy(p, "FIFO_EXIT"); + p += 9; + } + if (f & FIFO_EXERRNO) { + if (p > &fbuf[1]) + *p++ = '|'; + strcpy(p, "FIFO_EXERRNO"); + } + return (fbuf); +} + +LOCAL char * +prpflags(f, fbuf) + int f; + char *fbuf; +{ + char *p = fbuf; + + *p = '\0'; + if (f) + *p++ = '\t'; + + if (f & FIFO_MEOF) { + strcpy(p, "FIFO_MEOF"); + p += 9; + } + if (f & FIFO_O_CHREEL) { + if (p > &fbuf[1]) + *p++ = '|'; + strcpy(p, "FIFO_O_CHREEL"); + } + return (fbuf); +} +#endif + EXPORT void fifo_prmp(sig) int sig; { #ifdef HANG_DEBUG + char fbuf[100]; extern BOOL cflag; if (sig == 0 && !debug) @@ -499,13 +586,14 @@ error("ocnt: %ld\n", mp->ocnt); error("iblocked: %d\n", mp->iblocked); error("oblocked: %d\n", mp->oblocked); + error("mayoblock:%d\n", mp->mayoblock); error("m1: %d\n", mp->m1); error("m2: %d\n", mp->m2); error("chreel: %d\n", mp->chreel); error("reelwait: %d\n", mp->reelwait); - error("eflags: %2.2X\n", mp->eflags); - error("pflags: %2.2X\n", mp->pflags); - error("flags: %2.2X\n", mp->flags); + error("eflags: %2.2X%s\n", mp->eflags, preflags(mp->eflags, fbuf)); + error("pflags: %2.2X%s\n", mp->pflags, prpflags(mp->pflags, fbuf)); + error("flags: %2.2X%s\n", mp->gflags, prgflags(mp->gflags, fbuf)); error("hiw: %d\n", mp->hiw); error("low: %d\n", mp->low); error("puts: %d\n", mp->puts); @@ -597,7 +685,7 @@ pid, ret); errmsg("Ib %d Ob %d e %X p %X g %X chan %d.\n", mp->iblocked, mp->oblocked, - mp->eflags, mp->pflags, mp->flags, + mp->eflags, mp->pflags, mp->gflags, chan); } if ((mp->eflags & FIFO_EXERRNO) != 0) { @@ -639,11 +727,11 @@ return (write(f, &c, 1)); } -#define sgetwait(m, w) swait((m)->gpin, w) -#define sgetwakeup(m, c) swakeup((m)->gpout, (c)) +#define sgetwait(m, w) swait((m)->gpin, w) /* Wait in get side */ +#define sgetwakeup(m, c) swakeup((m)->gpout, (c)) /* Wakeup get side */ -#define sputwait(m, w) swait((m)->ppin, w) -#define sputwakeup(m, c) swakeup((m)->ppout, (c)) +#define sputwait(m, w) swait((m)->ppin, w) /* Wait in put side */ +#define sputwakeup(m, c) swakeup((m)->ppout, (c)) /* Wakeup put side */ /* * Return the amount of data from the FIFO available to the reader process. @@ -685,13 +773,20 @@ !((rmp->eflags & FIFO_EXIT) && cnt == '\0')) { errmsgno(EX_BAD, "Implementation botch: with FIFO_MEOF\n"); +#ifdef HANG_DEBUG + errmsgno(EX_BAD, + "Pid %ld expect 'n' eflags %x pflags %x gflags %x\n", + (long)getpid(), + rmp->eflags, rmp->pflags, rmp->gflags); + fifo_prmp(-1); +#endif comerrno(EX_BAD, "Did not wake up from fifo_chitape() - got '%c'.\n", cnt); } - if (rmp->flags & FIFO_I_CHREEL) { + if (rmp->gflags & FIFO_I_CHREEL) { changetape(TRUE); - rmp->flags &= ~FIFO_I_CHREEL; + rmp->gflags &= ~FIFO_I_CHREEL; rmp->pflags &= ~FIFO_MEOF; EDEBUG(("t")); sgetwakeup(rmp, 't'); @@ -700,12 +795,15 @@ } } while ((cnt = rmp->size - FIFO_AMOUNT(rmp)) < amount) { - if (rmp->flags & FIFO_MERROR) { + /* + * Wait until "amount" data fits into the fifo. + */ + if (rmp->gflags & FIFO_MERROR) { fifo_stats(); exit(1); } rmp->full++; - rmp->iblocked = TRUE; + rmp->iblocked = TRUE; /* Wait for space to become free */ EDEBUG(("i")); sputwait(rmp, 3); } @@ -736,6 +834,7 @@ int amount; { register m_head *rmp = mp; + register int iwait; if (amount <= 0) return; @@ -745,9 +844,13 @@ if (rmp->putptr >= rmp->end) rmp->putptr = rmp->base; - if (rmp->oblocked && - ((rmp->flags & FIFO_IWAIT) || - (FIFO_AMOUNT(rmp) >= rmp->low))) { + /* + * If FIFO_IWAIT was set, we always need to call sputwait(rmp, 4); as we + * always get a related wakeup. Since fifo_resume() clears that flag + * before sending the wakeup, we need to evaluate FIFO_IWAIT only once. + */ + iwait = rmp->gflags & FIFO_IWAIT; + if (rmp->oblocked && (iwait || (FIFO_AMOUNT(rmp) >= rmp->low))) { /* * Reset oblocked to make sure we send just one single * weakup event @@ -756,7 +859,13 @@ EDEBUG(("d")); sgetwakeup(rmp, 'd'); } - if ((rmp->flags & FIFO_IWAIT)) { + /* + * This is when the get side of the FIFO examins the data to decide + * e.g. whether the data needs to be swapped. If we did send the + * wakeup above, we always need to wait for a related wakup that + * permits us to continue. + */ + if (iwait) { EDEBUG(("I")); sputwait(rmp, 4); /* @@ -776,6 +885,14 @@ fifo_oflush() { mp->pflags |= FIFO_MEOF; + /* + * Make us immune gainst against delays caused by a context switch at + * the other side. usleep(1000) will usually not wait at all but may + * yield to a context switch. + */ + while (mp->mayoblock && !mp->oblocked) + usleep(1000); + if (mp->oblocked) { /* * Reset oblocked to make sure we send just one single @@ -840,7 +957,9 @@ /* * We need to check rmp->pflags & FIFO_MEOF first, because FIFO_AMOUNT() * gets updated before FIFO_MEOF. + * rmp->mayoblock is used to mark this block to avoid deadlocks. */ + rmp->mayoblock = TRUE; if ((rmp->pflags & (FIFO_MEOF|FIFO_O_CHREEL)) == 0) { cnt = FIFO_AMOUNT(rmp); if (cnt < amount) { @@ -852,12 +971,23 @@ * to detect that we expect a wakeup as rmp->oblocked * may be set after the Put process exited. */ + if (rmp->pflags & (FIFO_MEOF|FIFO_O_CHREEL)) { + /* + * There was a context switch between the flag + * check and the amount comutation. The related + * delay changed the state. + */ + rmp->mayoblock = FALSE; + goto again; + } rmp->empty++; rmp->oblocked = TRUE; + rmp->mayoblock = FALSE; EDEBUG(("o")); c = sgetwait(rmp, 5); } } + rmp->mayoblock = FALSE; if (rmp->pflags & FIFO_O_CHREEL) { cnt = FIFO_AMOUNT(rmp); @@ -935,7 +1065,7 @@ register m_head *rmp = mp; if (amt <= 0) { - rmp->flags |= FIFO_MERROR; + rmp->gflags |= FIFO_MERROR; exit(1); } @@ -946,6 +1076,9 @@ if (rmp->getptr >= rmp->end) rmp->getptr = rmp->base; + /* + * If rmp->iblocked is TRUE, the put side definitely waits for space. + */ if (rmp->iblocked && (FIFO_AMOUNT(rmp) <= rmp->hiw)) { /* * Reset iblocked to make sure we send just one single @@ -988,8 +1121,8 @@ { register m_head *rmp = mp; - if ((rmp->flags & FIFO_IWAIT) != 0) { - rmp->flags &= ~FIFO_IWAIT; + if ((rmp->gflags & FIFO_IWAIT) != 0) { + rmp->gflags &= ~FIFO_IWAIT; EDEBUG(("S")); sputwakeup(rmp, 'S'); } @@ -1098,7 +1231,7 @@ { char c; - mp->flags |= FIFO_I_CHREEL; + mp->gflags |= FIFO_I_CHREEL; if (mp->pflags & FIFO_MEOF) { EDEBUG(("n")); sputwakeup(mp, 'n'); @@ -1110,6 +1243,13 @@ c = sgetwait(mp, 6); if (c != 't') { errmsgno(EX_BAD, "Implementation botch: with FIFO_I_CHREEL\n"); +#ifdef HANG_DEBUG + errmsgno(EX_BAD, + "Pid %ld expect 't' eflags %x pflags %x gflags %x\n", + (long)getpid(), + mp->eflags, mp->pflags, mp->gflags); + fifo_prmp(-1); +#endif comerrno(EX_BAD, "Did not wake up from fifo_iwait() - got '%c'.\n", c); } @@ -1126,6 +1266,14 @@ char c; mp->pflags |= FIFO_O_CHREEL; + /* + * Make us immune gainst against delays caused by a context switch at + * the other side. usleep(1000) will usually not wait at all but may + * yield to a context switch. + */ + while (mp->mayoblock && !mp->oblocked) + usleep(1000); + if (mp->oblocked) { /* * Reset oblocked to make sure we send just one single @@ -1139,6 +1287,13 @@ c = sputwait(mp, 7); if (c != 'T') { errmsgno(EX_BAD, "Implementation botch: with FIFO_O_CHREEL\n"); +#ifdef HANG_DEBUG + errmsgno(EX_BAD, + "Pid %ld expect 'T' eflags %x pflags %x gflags %x\n", + (long)getpid(), + mp->eflags, mp->pflags, mp->gflags); + fifo_prmp(-1); +#endif comerrno(EX_BAD, "Did not wake up from fifo_owait() - got '%c'.\n", c); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/schily-2019-05-28/star/fifo.h new/schily-2019-06-13/star/fifo.h --- old/schily-2019-05-28/star/fifo.h 2018-10-22 23:43:59.000000000 +0200 +++ new/schily-2019-06-13/star/fifo.h 2019-06-06 21:22:44.000000000 +0200 @@ -1,4 +1,4 @@ -/* @(#)fifo.h 1.36 18/10/22 Copyright 1989-2018 J. Schilling */ +/* @(#)fifo.h 1.38 19/06/06 Copyright 1989-2018 J. Schilling */ /* * Definitions for a "fifo" that uses * shared memory between two processes @@ -81,7 +81,7 @@ * * In order to avoid the need for semaphores to control the change of values * in this structure, members marked with "P", are only modified by the - * put side of the FIFO and members marked with "G" are only marked by the + * put side of the FIFO and members marked with "G" are only modified by the * get side of the FIFO. * * Members marked with "P-" are set by the put side and reset by the get side. @@ -104,13 +104,15 @@ V unsigned long ocnt; /* G output count (incremented on each get) */ V char iblocked; /* P- input (put side) is blocked */ V char oblocked; /* G- output (get side) is blocked */ + V char mayoblock; /* G output (get side) may set oblocked */ V char m1; /* Semaphore claimed by newvolhdr() */ V char m2; /* Semaphore claimed by cr_file() */ V char chreel; /* Semaphore claimed by startvol() */ V char reelwait; /* P- input (put side) is blocked on "chreel" */ V char eflags; /* fifo exit flags */ V char pflags; /* fifo put flags */ - V int flags; /* fifo flags */ + V char gflags; /* fifo get flags */ + /* 2 or 6 bytes of padding */ V int ferrno; /* errno from fifo background process */ int hiw; /* highwater mark */ int low; /* lowwater mark */ @@ -140,6 +142,7 @@ /* * The FIFO flags are used only inside fifo.c * + * gflags: * FIFO_MERROR set by the get side * FIFO_IWAIT set by the put side before startup, reset by the get side * FIFO_I_CHREEL set by the get side, reset by the put side with get waiting @@ -151,6 +154,8 @@ * eflags: * FIFO_EXIT set by the side that decided to abort the program * FIFO_EXERRNO set by the side that decided to abort the program + * + * If we ever need more than 8 bits, we need to use a larger data type. */ #define FIFO_MERROR 0x001 /* G error on input (get side) */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/schily-2019-05-28/star/version.c new/schily-2019-06-13/star/version.c --- old/schily-2019-05-28/star/version.c 2019-04-01 00:39:22.000000000 +0200 +++ new/schily-2019-06-13/star/version.c 2019-06-08 20:03:58.000000000 +0200 @@ -1,8 +1,8 @@ -/* @(#)version.c 1.8 19/04/01 Copyright 2018-2019 J. Schilling */ +/* @(#)version.c 1.9 19/06/08 Copyright 2018-2019 J. Schilling */ #include <schily/mconfig.h> #ifndef lint static UConst char sccsid[] = - "@(#)version.c 1.8 19/04/01 Copyright 2018-2019 J. Schilling"; + "@(#)version.c 1.9 19/06/08 Copyright 2018-2019 J. Schilling"; #endif /* * Copyright (c) 2018-2019 J. Schilling @@ -21,5 +21,5 @@ * file and include the License file CDDL.Schily.txt from this distribution. */ -char strvers[] = "1.6"; /* The pure version string */ -char dvers[] = "2019/04/01"; /* Version date */ +char strvers[] = "1.6.1"; /* The pure version string */ +char dvers[] = "2019/06/08"; /* Version date */
