Skip to content

Commit

Permalink
dracut: add static linkage to internal functions
Browse files Browse the repository at this point in the history
Added the `static` keyword to functions that are not used outside their
respective source files to limit their linkage and prevent potential
symbol conflicts.
  • Loading branch information
KKoukiou committed Feb 24, 2025
1 parent ab3f9c7 commit 3103f20
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion dracut/dd/dd_extract.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ void show_help() {
* during cpio extraction, only extract files we need
* eg. module .ko files and firmware directory
*/
int dlabelFilter(const char* name, const struct stat *fstat, int packageflags, void *userptr)
static int dlabelFilter(const char* name, const struct stat *fstat, int packageflags, void *userptr)
{
int l = strlen(name);

Expand Down
6 changes: 3 additions & 3 deletions dracut/dd/dd_list.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ struct _version_struct {
char* anaconda;
};

int globErrFunc(const char *epath, int eerrno)
static int globErrFunc(const char *epath, int eerrno)
{
/* TODO check fatal errors */

Expand Down Expand Up @@ -86,7 +86,7 @@ void show_help() {
* we use it to check if kernel-modules = <kernel version>
* and installer-enhancement = <anaconda version>
*/
int dlabelProvides(const char* dep, const char* version, uint32_t sense, void *userptr)
static int dlabelProvides(const char* dep, const char* version, uint32_t sense, void *userptr)
{
char *kernelver = ((struct _version_struct*)userptr)->kernel;
char *anacondaver = ((struct _version_struct*)userptr)->anaconda;
Expand Down Expand Up @@ -132,7 +132,7 @@ int dlabelProvides(const char* dep, const char* version, uint32_t sense, void *u
/**
* Print information about the rpm to stdout
*/
int dlabelOK(const char* source, Header *h, int packageflags)
static int dlabelOK(const char* source, Header *h, int packageflags)
{
struct rpmtd_s tdname;
struct rpmtd_s tddesc;
Expand Down
6 changes: 3 additions & 3 deletions dracut/dd/rpmutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@ struct cpio_mydata {
* libarchive callbacks
*/

ssize_t rpm_myread(struct archive *a, void *client_data, const void **buff)
static ssize_t rpm_myread(struct archive *a, void *client_data, const void **buff)
{
struct cpio_mydata *mydata = client_data;
*buff = mydata->buffer;
return Fread(mydata->buffer, 1, BUFFERSIZE, mydata->gzdi);
}

int rpm_myclose(struct archive *a, void *client_data)
static int rpm_myclose(struct archive *a, void *client_data)
{
struct cpio_mydata *mydata = client_data;
if (mydata->gzdi > 0)
Expand All @@ -81,7 +81,7 @@ int init_rpm() {

/* read data from RPM header */

const char * headerGetString(Header h, rpmTagVal tag)
static const char * headerGetString(Header h, rpmTagVal tag)
{
const char *res = NULL;
struct rpmtd_s td;
Expand Down

0 comments on commit 3103f20

Please sign in to comment.