Change 32706

mark_zinthefer (Mark Zinthefer)
Mark Zinthefer committed this change into //guest/perforce_software/sdp/dev/Server/Unix/p4/common/bin
Request Review
Download .zip
Bug hunt with Claude.

Justification:

journal_watch.sh � Spurious comma in convert_to_bytes call (syntax/logic error)
When a threshold value ends with %, the script passes the total disk size as a second argument, but introduces a stray comma:

P4JOURNALMINBYTES=$(convert_to_bytes "$P4JOURNALMIN", "$P4JOURNALTOTAL")

The comma is outside the quotes, so bash passes "$P4JOURNALMIN", (literally with a trailing comma) as the first argument to convert_to_bytes. This will break the percentage-based threshold calculation entirely � the value won't be recognized as a percentage and the conversion will likely return 0 or garbage. The same error appears in all three percentage-handling blocks (P4JOURNALMIN, P4JOURNALWARN, P4JOURNALROTATE). The fix is to remove the commas:

P4JOURNALMINBYTES=$(convert_to_bytes "$P4JOURNALMIN" "$P4JOURNALTOTAL")
  • Files 1
  • Comments 0
1 edited 0 added 0 deleted
journal_watch.sh#7
Loading...
Tip: Use n and p to cycle through the changes.