Skip to content

Commit bf4ce2c

Browse files
committed
Forgot a check
1 parent fcef77d commit bf4ce2c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

ddcommon/src/unix_utils.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,10 @@ fn is_being_traced() -> io::Result<bool> {
192192

193193
for line in data.split(|&b| b == b'\n') {
194194
if let Ok(line_str) = std::str::from_utf8(line) {
195-
let tracer_pid = line_str.split_whitespace().nth(1).unwrap_or("0");
196-
return Ok(tracer_pid != "0");
195+
if line_str.starts_with("TracerPid:") {
196+
let tracer_pid = line_str.split_whitespace().nth(1).unwrap_or("0");
197+
return Ok(tracer_pid != "0");
198+
}
197199
}
198200
}
199201
Ok(false)

0 commit comments

Comments
 (0)