File tree 1 file changed +6
-6
lines changed
rosbag2_compression/src/rosbag2_compression
1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -95,17 +95,17 @@ void SequentialCompressionWriter::compression_thread_fn()
95
95
96
96
errno = 0 ;
97
97
int cur_nice_value = getpriority (PRIO_PROCESS, 0 );
98
- if (cur_nice_value != -1 && errno == 0 ) {
98
+ if (cur_nice_value == -1 && errno != 0 ) {
99
+ ROSBAG2_COMPRESSION_LOG_WARN_STREAM (
100
+ " Could not set nice value of compression thread to " << wanted_nice_value <<
101
+ " : Could not determine cur nice value" );
102
+ } else {
99
103
int new_nice_value = nice (wanted_nice_value - cur_nice_value);
100
- if ((new_nice_value == -1 && errno != 0 ) || new_nice_value != wanted_nice_value ) {
104
+ if ((new_nice_value == -1 && errno != 0 )) {
101
105
ROSBAG2_COMPRESSION_LOG_WARN_STREAM (
102
106
" Could not set nice value of compression thread to " << wanted_nice_value << " : " << std::strerror (
103
107
errno));
104
108
}
105
- } else {
106
- ROSBAG2_COMPRESSION_LOG_WARN_STREAM (
107
- " Could not set nice value of compression thread to " << wanted_nice_value <<
108
- " : Could not determine cur nice value" );
109
109
}
110
110
#endif
111
111
}
You can’t perform that action at this time.
0 commit comments