UPSCLI_DISCONNECT(3)

✨ UPSCLI_DISCONNECT(3) ✨

okay bestie, welcome to the NUT Manual page for upscli_disconnect β€” yes that's the manual name, it's giving very "libupsclient core library" and we're obsessed πŸ’–


🌸 NAME 🌸

upscli_disconnect β€” say bye-bye to your UPS server connection πŸ‘‹πŸ¦‹


πŸŽ€ SYNOPSIS πŸŽ€

#include <upsclient.h>

int upscli_disconnect(UPSCONN_t *ups);

πŸ’… DESCRIPTION πŸ’…

so like. upscli_disconnect() takes that pointer ups you've been holding onto β€” the one pointing at a UPSCONN_t state structure β€” and it shuts the whole connection to the server DOWN, then frees all the dynamic memory that state structure was hogging. clean girl behaviour, honestly 🧹✨

⚠️ heads up bestie: after you call this, the UPSCONN_t structure is no longer valid. like, do not touch it. it's gone. she's retired. periodt πŸ’€

and fr fr β€” this function must be called, or your program is gonna leak memory and file descriptors. not a vibe. not the main character energy we're going for 😭


πŸ”₯ RETURN VALUE πŸ”₯

upscli_disconnect() returns 0 on success, or -1 if an error occurs. that's it, that's the tea β˜•βœ¨


🌈 SEE ALSO 🌈


and that's the whole page, bestie β€” this icon was brought to you by Network UPS Tools 2.8.5, dated 10/07/2026 🫢 go free your file descriptors, you deserve it πŸ‘‘πŸ’œ

πŸ“¦ where this page comes from