Skip to content

Commit

Permalink
Merge pull request #6203 from KKoukiou/static-linkage
Browse files Browse the repository at this point in the history
dracut: add static linkage to internal functions
  • Loading branch information
KKoukiou authored Feb 24, 2025
2 parents ab3f9c7 + 3f4e041 commit 6702abe
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 24 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
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

0 comments on commit 6702abe

Please sign in to comment.