Skip to content

Commit aeb2a6b

Browse files
committed
Rename Signal::Alrm to Signal::Alarm, and several others.
Following a suggestion by @cgwalters in #177, which is in keeping with rustix's overall [philosophy] of using more human-friendly names, rename several `Signal` arms to re-insert missing inner vowels. This leaves some abbreviations in place, such as `Segv`; I'm open to suggestions here, but offhand it feels like these are sufficiently recognizable and convenient that they can stay as they are. [philosophy]: https://docs.rs/rustix/latest/rustix/#
1 parent dd7d6c8 commit aeb2a6b

File tree

2 files changed

+30
-20
lines changed

2 files changed

+30
-20
lines changed

src/imp/libc/process/types.rs

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,8 @@ pub enum Signal {
154154
Trap = c::SIGTRAP,
155155
/// `SIGABRT`, aka `SIGIOT`
156156
#[doc(alias = "Iot")]
157-
Abrt = c::SIGABRT,
157+
#[doc(alias = "Abrt")]
158+
Abort = c::SIGABRT,
158159
/// `SIGBUS`
159160
Bus = c::SIGBUS,
160161
/// `SIGFPE`
@@ -170,7 +171,8 @@ pub enum Signal {
170171
/// `SIGPIPE`
171172
Pipe = c::SIGPIPE,
172173
/// `SIGALRM`
173-
Alrm = c::SIGALRM,
174+
#[doc(alias = "Alrm")]
175+
Alarm = c::SIGALRM,
174176
/// `SIGTERM`
175177
Term = c::SIGTERM,
176178
/// `SIGSTKFLT`
@@ -183,7 +185,8 @@ pub enum Signal {
183185
)))]
184186
Stkflt = c::SIGSTKFLT,
185187
/// `SIGCHLD`
186-
Chld = c::SIGCHLD,
188+
#[doc(alias = "Chld")]
189+
Child = c::SIGCHLD,
187190
/// `SIGCONT`
188191
Cont = c::SIGCONT,
189192
/// `SIGSTOP`
@@ -201,7 +204,8 @@ pub enum Signal {
201204
/// `SIGXFSZ`
202205
Xfsz = c::SIGXFSZ,
203206
/// `SIGVTALRM`
204-
Vtalrm = c::SIGVTALRM,
207+
#[doc(alias = "Vtalrm")]
208+
Vtalarm = c::SIGVTALRM,
205209
/// `SIGPROF`
206210
Prof = c::SIGPROF,
207211
/// `SIGWINCH`
@@ -217,7 +221,8 @@ pub enum Signal {
217221
target_os = "netbsd",
218222
target_os = "openbsd"
219223
)))]
220-
Pwr = c::SIGPWR,
224+
#[doc(alias = "Pwr")]
225+
Power = c::SIGPWR,
221226
/// `SIGSYS`, aka `SIGUNUSED`
222227
#[doc(alias = "Unused")]
223228
Sys = c::SIGSYS,
@@ -233,15 +238,15 @@ impl Signal {
233238
c::SIGQUIT => Some(Self::Quit),
234239
c::SIGILL => Some(Self::Ill),
235240
c::SIGTRAP => Some(Self::Trap),
236-
c::SIGABRT => Some(Self::Abrt),
241+
c::SIGABRT => Some(Self::Abort),
237242
c::SIGBUS => Some(Self::Bus),
238243
c::SIGFPE => Some(Self::Fpe),
239244
c::SIGKILL => Some(Self::Kill),
240245
c::SIGUSR1 => Some(Self::Usr1),
241246
c::SIGSEGV => Some(Self::Segv),
242247
c::SIGUSR2 => Some(Self::Usr2),
243248
c::SIGPIPE => Some(Self::Pipe),
244-
c::SIGALRM => Some(Self::Alrm),
249+
c::SIGALRM => Some(Self::Alarm),
245250
c::SIGTERM => Some(Self::Term),
246251
#[cfg(not(any(
247252
target_os = "freebsd",
@@ -251,7 +256,7 @@ impl Signal {
251256
target_os = "openbsd",
252257
)))]
253258
c::SIGSTKFLT => Some(Self::Stkflt),
254-
c::SIGCHLD => Some(Self::Chld),
259+
c::SIGCHLD => Some(Self::Child),
255260
c::SIGCONT => Some(Self::Cont),
256261
c::SIGSTOP => Some(Self::Stop),
257262
c::SIGTSTP => Some(Self::Tstp),
@@ -260,7 +265,7 @@ impl Signal {
260265
c::SIGURG => Some(Self::Urg),
261266
c::SIGXCPU => Some(Self::Xcpu),
262267
c::SIGXFSZ => Some(Self::Xfsz),
263-
c::SIGVTALRM => Some(Self::Vtalrm),
268+
c::SIGVTALRM => Some(Self::Vtalarm),
264269
c::SIGPROF => Some(Self::Prof),
265270
c::SIGWINCH => Some(Self::Winch),
266271
c::SIGIO => Some(Self::Io),
@@ -271,7 +276,7 @@ impl Signal {
271276
target_os = "netbsd",
272277
target_os = "openbsd",
273278
)))]
274-
c::SIGPWR => Some(Self::Pwr),
279+
c::SIGPWR => Some(Self::Power),
275280
c::SIGSYS => Some(Self::Sys),
276281
_ => None,
277282
}

src/imp/linux_raw/process/types.rs

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ pub enum Signal {
9393
Trap = linux_raw_sys::general::SIGTRAP,
9494
/// `SIGABRT`, aka `SIGIOT`
9595
#[doc(alias = "Iot")]
96-
Abrt = linux_raw_sys::general::SIGABRT,
96+
#[doc(alias = "Abrt")]
97+
Abort = linux_raw_sys::general::SIGABRT,
9798
/// `SIGBUS`
9899
Bus = linux_raw_sys::general::SIGBUS,
99100
/// `SIGFPE`
@@ -109,13 +110,15 @@ pub enum Signal {
109110
/// `SIGPIPE`
110111
Pipe = linux_raw_sys::general::SIGPIPE,
111112
/// `SIGALRM`
112-
Alrm = linux_raw_sys::general::SIGALRM,
113+
#[doc(alias = "Alrm")]
114+
Alarm = linux_raw_sys::general::SIGALRM,
113115
/// `SIGTERM`
114116
Term = linux_raw_sys::general::SIGTERM,
115117
/// `SIGSTKFLT`
116118
Stkflt = linux_raw_sys::general::SIGSTKFLT,
117119
/// `SIGCHLD`
118-
Chld = linux_raw_sys::general::SIGCHLD,
120+
#[doc(alias = "Chld")]
121+
Child = linux_raw_sys::general::SIGCHLD,
119122
/// `SIGCONT`
120123
Cont = linux_raw_sys::general::SIGCONT,
121124
/// `SIGSTOP`
@@ -133,7 +136,8 @@ pub enum Signal {
133136
/// `SIGXFSZ`
134137
Xfsz = linux_raw_sys::general::SIGXFSZ,
135138
/// `SIGVTALRM`
136-
Vtalrm = linux_raw_sys::general::SIGVTALRM,
139+
#[doc(alias = "Vtalrm")]
140+
Vtalarm = linux_raw_sys::general::SIGVTALRM,
137141
/// `SIGPROF`
138142
Prof = linux_raw_sys::general::SIGPROF,
139143
/// `SIGWINCH`
@@ -142,7 +146,8 @@ pub enum Signal {
142146
#[doc(alias = "Poll")]
143147
Io = linux_raw_sys::general::SIGIO,
144148
/// `SIGPWR`
145-
Pwr = linux_raw_sys::general::SIGPWR,
149+
#[doc(alias = "Pwr")]
150+
Power = linux_raw_sys::general::SIGPWR,
146151
/// `SIGSYS`, aka `SIGUNUSED`
147152
#[doc(alias = "Unused")]
148153
Sys = linux_raw_sys::general::SIGSYS,
@@ -159,18 +164,18 @@ impl Signal {
159164
linux_raw_sys::general::SIGQUIT => Some(Self::Quit),
160165
linux_raw_sys::general::SIGILL => Some(Self::Ill),
161166
linux_raw_sys::general::SIGTRAP => Some(Self::Trap),
162-
linux_raw_sys::general::SIGABRT => Some(Self::Abrt),
167+
linux_raw_sys::general::SIGABRT => Some(Self::Abort),
163168
linux_raw_sys::general::SIGBUS => Some(Self::Bus),
164169
linux_raw_sys::general::SIGFPE => Some(Self::Fpe),
165170
linux_raw_sys::general::SIGKILL => Some(Self::Kill),
166171
linux_raw_sys::general::SIGUSR1 => Some(Self::Usr1),
167172
linux_raw_sys::general::SIGSEGV => Some(Self::Segv),
168173
linux_raw_sys::general::SIGUSR2 => Some(Self::Usr2),
169174
linux_raw_sys::general::SIGPIPE => Some(Self::Pipe),
170-
linux_raw_sys::general::SIGALRM => Some(Self::Alrm),
175+
linux_raw_sys::general::SIGALRM => Some(Self::Alarm),
171176
linux_raw_sys::general::SIGTERM => Some(Self::Term),
172177
linux_raw_sys::general::SIGSTKFLT => Some(Self::Stkflt),
173-
linux_raw_sys::general::SIGCHLD => Some(Self::Chld),
178+
linux_raw_sys::general::SIGCHLD => Some(Self::Child),
174179
linux_raw_sys::general::SIGCONT => Some(Self::Cont),
175180
linux_raw_sys::general::SIGSTOP => Some(Self::Stop),
176181
linux_raw_sys::general::SIGTSTP => Some(Self::Tstp),
@@ -179,11 +184,11 @@ impl Signal {
179184
linux_raw_sys::general::SIGURG => Some(Self::Urg),
180185
linux_raw_sys::general::SIGXCPU => Some(Self::Xcpu),
181186
linux_raw_sys::general::SIGXFSZ => Some(Self::Xfsz),
182-
linux_raw_sys::general::SIGVTALRM => Some(Self::Vtalrm),
187+
linux_raw_sys::general::SIGVTALRM => Some(Self::Vtalarm),
183188
linux_raw_sys::general::SIGPROF => Some(Self::Prof),
184189
linux_raw_sys::general::SIGWINCH => Some(Self::Winch),
185190
linux_raw_sys::general::SIGIO => Some(Self::Io),
186-
linux_raw_sys::general::SIGPWR => Some(Self::Pwr),
191+
linux_raw_sys::general::SIGPWR => Some(Self::Power),
187192
linux_raw_sys::general::SIGSYS => Some(Self::Sys),
188193
linux_raw_sys::general::SIGRTMIN => Some(Self::Rtmin),
189194
_ => None,

0 commit comments

Comments
 (0)