feat(bkgpslog):Force ordered write operations with wait
[EVA-2020-02.git] / exec / bkgpslog
index 6308e09d401e4c81c8a1cc76ef6655166c711dae..c7cae3658a928b3415c94899c941e7cb7b498e57 100755 (executable)
@@ -664,6 +664,7 @@ appendArgTar(){
 magicWriteBuffer() {
     # Desc: bkgpslog-specific meta function for writing data to DIR_TMP then appending each file to PATHOUT_TAR
     local FN="${FUNCNAME[0]}";
+    wait; # Wait to avoid collision with older magicWriteBuffer() instances (see https://www.tldp.org/LDP/abs/html/x9644.html )
     yell "DEBUG:STATUS:$FN:Started magicWriteBuffer().";
     appendArgTar "$bufferBash" "$FILEOUT_NMEA" "$PATHOUT_TAR" "$DIR_TMP" "$CMD_CONV_NMEA" "$CMD_COMPRESS" "$CMD_ENCRYPT"; # Write NMEA data
     appendArgTar "$bufferBash" "$FILEOUT_GPX" "$PATHOUT_TAR" "$DIR_TMP" "$CMD_CONV_GPX" "$CMD_COMPRESS" "$CMD_ENCRYPT"; # Write GPX file