Skip to content

Commit 7bcbc6a

Browse files
committed
Prepare for release
1 parent 9fef37f commit 7bcbc6a

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changelog
22

3+
## [0.5.0] - 2025-01-18
4+
5+
### Changed
6+
7+
- (breaking) the `unset_env` parameters were split off into separate unsafe functions
8+
- (breaking) `watchdog_enabled` now returns `Option<Duration>`
9+
310
## [0.4.5] - 2025-01-18
411

512
### Fixed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "sd-notify"
3-
version = "0.4.5"
3+
version = "0.5.0"
44
edition = "2021"
55
description = "Lightweight crate for systemd service state notifications"
66
readme = "README.md"

src/lib.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
2424
use std::convert::TryFrom;
2525
use std::env;
26+
use std::ffi::OsStr;
2627
use std::fmt::{self, Display, Formatter, Write};
2728
use std::fs;
28-
use std::ffi::OsStr;
2929
use std::io::{self, ErrorKind};
3030
use std::mem::MaybeUninit;
3131
#[cfg(feature = "fdstore")]
@@ -230,10 +230,7 @@ pub unsafe fn notify_and_unset_env(state: &[NotifyState]) -> io::Result<()> {
230230
/// let _ = sd_notify::notify_with_fds(&[NotifyState::FdStore], &[fd]);
231231
/// ```
232232
#[cfg(feature = "fdstore")]
233-
pub fn notify_with_fds(
234-
state: &[NotifyState],
235-
fds: &[BorrowedFd<'_>],
236-
) -> io::Result<()> {
233+
pub fn notify_with_fds(state: &[NotifyState], fds: &[BorrowedFd<'_>]) -> io::Result<()> {
237234
use sendfd::SendWithFd;
238235

239236
let Some(socket_path) = env::var_os(NOTIFY_SOCKET) else {
@@ -405,7 +402,8 @@ pub fn listen_fds_with_names() -> io::Result<impl ExactSizeIterator<Item = (RawF
405402
/// preconditions. See its safety documentation for more details. It can only
406403
/// be safely called before threads are spawned, in particular before any
407404
/// `tokio` runtime initialization or `#[tokio::main]`.
408-
pub unsafe fn listen_fds_with_names_and_unset_env() -> io::Result<impl ExactSizeIterator<Item = (RawFd, String)>> {
405+
pub unsafe fn listen_fds_with_names_and_unset_env(
406+
) -> io::Result<impl ExactSizeIterator<Item = (RawFd, String)>> {
409407
let result = listen_fds_with_names();
410408
unsafe {
411409
env::remove_var(LISTEN_PID);

0 commit comments

Comments
 (0)