Displaying 20 results from an estimated 2416 matches for "fprintf".
Did you mean:
sprintf
2011 Jan 28
3
any similiar R fuction for matlab function 'fprintf'?
Dear All,
Currently, I am translating Matlab code to R. I met difficulties to translate such Matlab codes into R:
fprintf(fid,(' SPLITTING RESULTS '));
fprintf(fid,(' \n'));
fprintf(fid,' Data base to analyze is a matrix %4i x %2i ',[n m]);
fprintf(fid,' \n');
fprintf(fid,' h is %2i',h);
fprintf(fid,' \n');
fprintf(fid,' group=0 outlier.\n');
fprintf(fid,' gr...
2011 Apr 13
1
[PATCH hivex] maint: split long lines
...7 Petter Nordahl-Hagen.
* Derived from code by Markus Stephany under a compatible license:
@@ -415,7 +415,8 @@ hivex_open (const char *filename, int flags)
page->magic[1] != 'b' ||
page->magic[2] != 'i' ||
page->magic[3] != 'n') {
- fprintf (stderr, "hivex: %s: trailing garbage at end of file (at 0x%zx, after %zu pages)\n",
+ fprintf (stderr, "hivex: %s: trailing garbage at end of file "
+ "(at 0x%zx, after %zu pages)\n",
filename, off, pages);
errno = ENOTSUP;
go...
2020 Oct 06
2
[PATCH libnbd] info: Write output atomically.
...probe_content = false;
+ /* Try to write output atomically. We spool output into a
+ * memstream, pointed to by fp, and write it all at once at the end.
+ * On error nothing should be printed on stdout.
+ */
+ fp = open_memstream (&output, &output_len);
+ if (fp == NULL) {
+ fprintf (stderr, "%s: ", progname);
+ perror ("open_memstream");
+ exit (EXIT_FAILURE);
+ }
+
/* Open the NBD side. */
nbd = nbd_create ();
if (nbd == NULL) {
@@ -250,7 +264,7 @@ main (int argc, char *argv[])
exit (EXIT_FAILURE);
}
- printf ("%"...
2012 Sep 14
1
[PATCH] xenpm: make argument parsing and error handling more consistent
...w_help(void)
@@ -77,6 +77,33 @@ void help_func(int argc, char *argv[])
show_help();
}
+static void parse_cpuid(const char *arg, int *cpuid)
+{
+ if ( sscanf(arg, "%d", cpuid) != 1 || *cpuid < 0 )
+ {
+ if ( strcasecmp(arg, "all") )
+ {
+ fprintf(stderr, "Invalid CPU identifier: ''%s''\n", arg);
+ exit(EINVAL);
+ }
+ *cpuid = -1;
+ }
+}
+
+static void parse_cpuid_and_int(int argc, char *argv[],
+ int *cpuid, int *val, const char *what)
+{
+ if ( argc >...
2011 Apr 15
2
[PATCH] Escape DHCP options written to /tmp/net-$DEVCICE.conf
...ain.c
index 76708a9..e53e22c 100644
--- a/usr/kinit/ipconfig/main.c
+++ b/usr/kinit/ipconfig/main.c
@@ -95,6 +95,25 @@ static void configure_device(struct netdev *dev)
dev->hostname, dev->name);
}
+static void write_option(FILE* f, const char* name, const char* value)
+{
+ int i=0;
+
+ fprintf(f, "%s=\"", name);
+ while (value[i]) {
+ switch (value[i]) {
+ case '"':
+ case '$':
+ case '`':
+ case '\\':
+ fprintf(f, "\\");
+ }
+ fprintf(f, "%c", value[i]);
+ ++i;
+ }
+ fprintf(f, "\"\n");...
2016 Apr 04
0
[PATCH 2/2] Use 'error' function for fprintf followed by exit.
Like with the previous commit, this replaces instances of:
if (something_bad) {
fprintf (stderr, "%s: error message\n", guestfs_int_program_name);
exit (EXIT_FAILURE);
}
with:
if (something_bad)
error (EXIT_FAILURE, 0, "error message");
(except in a few cases were errno was incorrectly being ignored, in
which case I have fixed that).
It's slight...
2002 Nov 25
0
Linux and Samba Code
...derr);
int main (
int argc,
char **argv)
{
int fd;
struct passwd *pwentry;
char name[STRLEN];
char newpw[STRLEN];
int reallyroot = 0;
char *cp;
FILE *mystderr;
/* do we have the appropriate permissions? */
if (geteuid() != 0) {
fprintf(stderr, "This program cannot run unless it is SUID-root, "
"exiting...\n");
exit(1);
}
if (getuid() == 0)
reallyroot = 1;
/* get the appropriate username */
if (argc > 1) {
if (reallyroot) {
/* if root, we can specify a usernam...
2005 Nov 08
1
TrippLite OMNI1000LCD hiddev
Joel Peshkin wrote:
>
> I hacked in the following additonal changes...
>
> Index: newhidups.c
> ===================================================================
> RCS file: /cvsroot/nut/nut/drivers/newhidups.c,v
> retrieving revision 1.1.1.1.8.6.2.21
> diff -u -r1.1.1.1.8.6.2.21 newhidups.c
> --- newhidups.c 7 Nov 2005 22:14:20 -0000 1.1.1.1.8.6.2.21
> +++
2016 Sep 08
4
[PATCH 0/3] Use gnulib's getprogname
Hi,
this series update libguestfs to a recent gnulib version, so that we
can use its new getprogname module, and solve altogether one of the
porting issues (the need for 'program_name' by the error module of
gnulib), and have a single way to get the name of the current program.
A number of changes in tools mostly, although mechanical.
Thanks,
Pino Toscano (3):
Update gnulib to latest
2009 Aug 24
5
[0/5] guestfish: detect stdout-write failure
Nearly any program that writes to standard output can
benefit from this sort of fix.
Without it, running e.g., ./guestfish --version > /dev/full
would exit successfully, even though it got ENOSPC
when writing to the full device. That means regular
output redirected to a file on a full partition may also
fail to be written, and the error ignored.
Before:
$ guestfish --version >
2004 Sep 10
2
flac_read callback not called in Windows?
...at follows is the code I am using, my
program just sits looping in the while block in the flac_update function:
// callback for the stream
// we need to get length words from the flac decode into the buffer
static void flac_update(int param, INT16 *buffer, int length)
{
FLAC__bool res = true;
fprintf(stderr, "start flac_update...");
//TODO: check for playing? probably a better way to stop the sound
if(laserdisc_playing)
{
while(length && res)
{
// need to decode some more data
if(!decoded_samples)
{
// fprintf(stderr, "start flac_seekable_decoder_proces...
2017 Mar 31
0
[PATCH 2/3] Use Unicode single quotes ‘’ in place of `' in strings throughout.
...++---------------
22 files changed, 37 insertions(+), 37 deletions(-)
diff --git a/align/scan.c b/align/scan.c
index 175df1e83..7ae8adf1f 100644
--- a/align/scan.c
+++ b/align/scan.c
@@ -76,7 +76,7 @@ static void __attribute__((noreturn))
usage (int status)
{
if (status != EXIT_SUCCESS)
- fprintf (stderr, _("Try `%s --help' for more information.\n"),
+ fprintf (stderr, _("Try ‘%s --help’ for more information.\n"),
getprogname ());
else {
printf (_("%s: check alignment of virtual machine partitions\n"
diff --git a/cat/cat.c b/cat/cat...
2001 Nov 06
1
incorrect xlim error message in image() (PR#1160)
...elping me
with figureing it out and he sugegstedd that it's a bug and sent me the
following email:
_____________________
For giggles, I tweaked plot3d.c to track where the error occured. The diff
output is:
!!!THIS PATCH IS A BUG TRACE, NOT A BUG FIX!!!
--PATCH BEGINS --
1518a1519
> fprintf(stderr,"test 1\n");
1519a1521
> fprintf(stderr,"test 2\n");
1520a1523
> fprintf(stderr,"test 3\n");
1522,1524c1525,1542
< for (i = 1; i < nx; i++)
< if (!R_FINITE(x[i]) || x[i] <= x[i - 1]) goto badxy;
< for (j = 1; j < ny;...
2013 Jul 08
2
Re: deadlock on connection loosing
On 07.07.2013 01:53, Александр wrote:
> В письме от Воскресенье, 30-июн-2013 03:41:37 пользователь Александр написал:
>> В письме от Вторник, 25-июн-2013 11:47:10 пользователь Michal Privoznik
....
>
> i have found source of problem, my code looks like this:
>
> int count = virConnectListAllDomains(connection, NULL, 0);
> ....
> domain = virDomainDefineXML(connection,
2005 Sep 03
1
Current status on _outgoing_ Swedish/Dutch DTMF CLIP for TDM400 FXS interfaces?
...ZT_TONE_CONGESTION,
ZT_TONE_DIALRECALL,
};
int main(int argc, char *argv[])
{
ZT_DIAL_OPERATION dop;
struct wctdm_regop regop;
struct zt_dialparams dps;
int fd,ctlfd,toneduration;
int res;
int x;
if (argc < 3) {
fprintf(stderr, "Usage: fxstest <zap device> <cmd>\n"
" where cmd is one of:\n"
" stats - reports voltages\n"
" regdump - dumps ProSLIC registers\n"...
2009 Nov 20
1
fix new failures from latest-from-gnulib syntax-check
....*\.java$
+^.*\.pl$
diff --git a/capitests/test-command.c b/capitests/test-command.c
index 7a3e64b..e5cdc93 100644
--- a/capitests/test-command.c
+++ b/capitests/test-command.c
@@ -57,12 +57,12 @@ main (int argc, char *argv[])
printf ("Result11-1\nResult11-2");
} else {
fprintf (stderr, "unknown parameter: %s\n", argv[1]);
- exit (1);
+ exit (EXIT_FAILURE);
}
} else {
fprintf (stderr, "missing parameter\n");
- exit (1);
+ exit (EXIT_FAILURE);
}
- exit (0);
+ exit (EXIT_SUCCESS);
}
diff --git a/daemon/guestfsd.c b/dae...
2015 Oct 22
8
RFC: Inlining report
...NC: copyFileName
DEAD STATIC FUNC: showFileNames
DEAD STATIC FUNC: stat
....
COMPILE FUNC: cleanUpAndFail
-> llvm.lifetime.start
[[Callee is intrinsic]]
-> INLINE: stat (35<=487)
<<Callee is single basic block>>
-> EXTERN: __xstat
-> EXTERN: fprintf
-> EXTERN: fclose
-> EXTERN: remove
-> EXTERN: fprintf
-> EXTERN: fprintf
-> EXTERN: fprintf
-> EXTERN: fprintf
-> EXTERN: fprintf
-> EXTERN: fprintf
-> INLINE: setExit (15<=225)
<<Inlining is profitable>>
-> EXTERN: e...
2019 Jun 28
3
[libnbd PATCH] tests: Enhance errors test
...heck (int experr, const char *prefix)
+{
+ const char *msg = nbd_get_error ();
+ int errnum = nbd_get_errno ();
+
+ printf ("error: \"%s\"\n", msg);
+ printf ("errno: %d (%s)\n", errnum, strerror (errnum));
+ if (strncmp (msg, prefix, strlen (prefix)) != 0) {
+ fprintf (stderr, "%s: test failed: missing context prefix: %s\n",
+ progname, msg);
+ exit (EXIT_FAILURE);
+ }
+ if (errnum != experr) {
+ fprintf (stderr, "%s: test failed: "
+ "expected errno = %d (%s), but got %d\n",
+ progname, e...
2005 Jul 26
1
Linux in-kernel keys support
...uot;, buf, 0);
+ if (ret < 0) {
+ printf("In-kernel key %s not found\n", filename);
+ return -1;
+ }
+
+ if (keyctl_unlink((key_serial_t) ret, KEY_SPEC_USER_SESSION_KEYRING) < 0) {
+ printf("Error when removing in-kernel key %d\n", ret);
+ return -1;
+ }
+
+ fprintf(stderr, "In-kernel key %d (%s) removed\n", ret, filename);
+ return 0;
+ }
+#endif
public = key_load_public(filename, &comment);
if (public == NULL) {
printf("Bad key file %s\n", filename);
@@ -108,6 +134,65 @@
{
int ret = -1;
+#ifdef HAVE_LIBKEYUTIL
+ if (inker...
2008 Jan 07
1
[PATCH]Add rollback support for the converter
...ze);
+
+ ret = fsync(fd);
+ if (ret)
+ goto fail;
+
+ memset(buf, 0, sectorsize);
+ for (bytenr = 0; bytenr < BTRFS_SUPER_INFO_OFFSET; ) {
+ len = BTRFS_SUPER_INFO_OFFSET - bytenr;
+ if (len > sectorsize)
+ len = sectorsize;
+ ret = pwrite(fd, buf, len, bytenr);
+ if (ret != len) {
+ fprintf(stderr, "unable to zero fill device\n");
+ break;
+ }
+ bytenr += len;
+ }
+ ret = 0;
+ fsync(fd);
fail:
+ free(buf);
+ if (ret > 0)
+ ret = -1;
return ret;
}
-int main(int argc, char *argv[])
+int do_convert(const char *devname, int datacsum)
{
int i, fd, ret;
u32 block...