Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dracut: add static linkage to internal functions #6203

Merged
merged 2 commits into from
Feb 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
21 changes: 2 additions & 19 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 @@ -78,23 +78,6 @@ int init_rpm() {
return rpmReadConfigFiles(NULL, NULL);
}


/* read data from RPM header */

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

if (headerGet(h, tag, &td, HEADERGET_MINMEM)) {
if (rpmtdCount(&td) == 1) {
res = rpmtdGetString(&td);
}
rpmtdFreeData(&td);
}
return res;
}

/*
*
*/
Expand Down
1 change: 0 additions & 1 deletion dracut/dd/rpmutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ typedef int (*dependencyfunc)(const char* depname, const char* depversion, const
*/
typedef int (*okfunc)(const char* filename, Header *rpmheader, int packageflags);

const char * headerGetString(Header h, rpmTagVal tag);
int init_rpm();
int checkDDRPM(const char *source,
dependencyfunc provides,
Expand Down