Skip to content

Commit

Permalink
libublksrv: define _GNU_SOURCE only if it is not already defined
Browse files Browse the repository at this point in the history
ublksrv needs _GNU_SOURCE defined for using cpu_set_t. While
integrating with external build system like AOSP, these are defined
using CFLAGS (-D_GNU_SOURCE). This causes _GNU_SOURCE redefined build
errors so let's wrap this definition under ifndef which will preserve
original intention while making the integration easier.

Signed-off-by: Sandeep Dhavale <[email protected]>
  • Loading branch information
dhavale committed Nov 11, 2024
1 parent 3fc6c38 commit 9094910
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/ublksrv_aio.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
// SPDX-License-Identifier: MIT or LGPL-2.1-only

#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif

#include "ublksrv_priv.h"

#define aio_log ublk_log
Expand Down

0 comments on commit 9094910

Please sign in to comment.