Skip to content

Commit

Permalink
fix pidof
Browse files Browse the repository at this point in the history
  • Loading branch information
jiacai2050 committed Oct 30, 2024
1 parent 9e01903 commit 3a353b6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ fn makeCompileStep(
) ?*Build.Step.Compile {
const name = comptime source.name();
const path = comptime source.path();
if (std.mem.eql(u8, name, "night-shift") or std.mem.eql(u8, name, "dark-mode") or std.mem.eql(u8, name, "pidof")) {
if (std.mem.eql(u8, name, "night-shift") or std.mem.eql(u8, name, "dark-mode")) {
// if (target.getOsTag() != .macos) {
if (is_ci) {
// zig build -Dtarget=aarch64-macos will throw error
Expand Down Expand Up @@ -197,7 +197,7 @@ fn makeCompileStep(
} else if (std.mem.eql(u8, name, "dark-mode")) {
exe.addFrameworkPath(.{ .cwd_relative = "/System/Library/PrivateFrameworks" });
exe.linkFramework("SkyLight");
} else if (std.mem.eql(u8, name, "tcp-proxy")) {
} else if (std.mem.eql(u8, name, "tcp-proxy") or std.mem.eql(u8, name, "pidof")) {
exe.linkLibC();
}
const install_step = b.step("install-" ++ name, "Install " ++ name);
Expand Down
4 changes: 2 additions & 2 deletions src/bin/pidof.zig
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,12 @@ pub fn main() !void {
const opt = try simargs.parse(allocator, Options, "[program]", util.get_build_info());
defer opt.deinit();

if (opt.positional_args.items.len == 0) {
if (opt.positional_args.len == 0) {
std.debug.print("program is not given", .{});
std.posix.exit(1);
}

const program = opt.positional_args.items[0];
const program = opt.positional_args[0];

const pids = try findPids(allocator, opt.args, program);
if (pids.items.len == 0) {
Expand Down

0 comments on commit 3a353b6

Please sign in to comment.