Hi Franky.
This patch changes the interface to lk_karma_write_file_chunk() so
that const char is used instead of char. This makes more sense when
using it from within lkarmafs.
The patch also removes the spurious free(db) introduced in hg90.
Keith.
# HG changeset patch
# User Keith Bennett <[EMAIL PROTECTED]>
# Node ID 5dbeb0c02c71424e8015ca748a3b737677b5d3ae
# Parent 083f8107331f2ad6062ab2616f8603266352bd48
Change interface to lk_karma_write_file_chunk() to make it
compatible with lkarmafs.
Revert premature freeing of db.
diff -r 083f8107331f -r 5dbeb0c02c71 src/karma.c
--- a/src/karma.c Sun Jul 30 11:10:47 2006
+++ b/src/karma.c Sun Jul 30 21:07:58 2006
@@ -205,7 +205,7 @@
int32_t lk_karma_write_file_chunk(int rio, uint64_t offset, uint64_t size,
uint32_t file_id, uint32_t storage_id,
- char *data)
+ const char *data)
{
return lk_ops->lk_karma_write_file_chunk(rio, offset, size, file_id,
storage_id, data);
diff -r 083f8107331f -r 5dbeb0c02c71 src/karma.h
--- a/src/karma.h Sun Jul 30 11:10:47 2006
+++ b/src/karma.h Sun Jul 30 21:07:58 2006
@@ -68,7 +68,7 @@
int32_t (*lk_karma_read_file_chunk)(int rio, uint64_t offset,
uint64_t size, uint32_t file_id, char **data, uint64_t * retsize);
int32_t (*lk_karma_write_file_chunk)(int rio, uint64_t offset,
- uint64_t size, uint32_t file_id, uint32_t storage_id, char *data);
+ uint64_t size, uint32_t file_id, uint32_t storage_id, const char
*data);
int32_t (*lk_karma_delete_file)(int rio, uint32_t file_id);
int32_t (*lk_karma_format_storage)(int rio, uint32_t storage_id);
int32_t (*lk_karma_device_operation)(int rio, uint64_t size, char *data,
diff -r 083f8107331f -r 5dbeb0c02c71 src/karmaLan.c
--- a/src/karmaLan.c Sun Jul 30 11:10:47 2006
+++ b/src/karmaLan.c Sun Jul 30 21:07:58 2006
@@ -370,7 +370,7 @@
int32_t lk_karmaLan_write_file_chunk(int rio, uint64_t offset, uint64_t size,
uint32_t file_id, uint32_t storage_id,
- char *data)
+ const char *data)
{
char * packet;
uint64_t align_diff = ( (size % 4) ? 4 - (size % 4) : 0 );
diff -r 083f8107331f -r 5dbeb0c02c71 src/karmaLan.h
--- a/src/karmaLan.h Sun Jul 30 11:10:47 2006
+++ b/src/karmaLan.h Sun Jul 30 21:07:58 2006
@@ -73,7 +73,8 @@
uint32_t storage_id);
int32_t lk_karmaLan_write_file_chunk (int rio, uint64_t offset,
uint64_t size, uint32_t file_id,
- uint32_t storage_id, char *data);
+ uint32_t storage_id,
+ const char *data);
int32_t lk_karmaLan_get_all_file_details (int rio, char **properties);
int32_t lk_karmaLan_get_file_details (int rio, uint32_t file_id,
char **properties);
diff -r 083f8107331f -r 5dbeb0c02c71 src/karmaUsb.c
--- a/src/karmaUsb.c Sun Jul 30 11:10:47 2006
+++ b/src/karmaUsb.c Sun Jul 30 21:07:58 2006
@@ -742,7 +742,6 @@
free(db->dmap);
if (db->playlists)
free(db->playlists);
- free(db);
}
if(fp)
fclose(fp);
@@ -796,7 +795,7 @@
/* --------------------------------------------------------------------------
*/
int32_t lk_karmaUsb_write_file_chunk(int rio, uint64_t offset, uint64_t size,
uint32_t file_id, uint32_t storage_id,
- char *data)
+ const char *data)
{
#define PERMS S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH
int fd;
diff -r 083f8107331f -r 5dbeb0c02c71 src/karmaUsb.h
--- a/src/karmaUsb.h Sun Jul 30 11:10:47 2006
+++ b/src/karmaUsb.h Sun Jul 30 21:07:58 2006
@@ -33,7 +33,8 @@
int32_t lk_karmaUsb_release_io_lock (int rio);
int32_t lk_karmaUsb_write_file_chunk (int rio, uint64_t offset,
uint64_t size, uint32_t file_id,
- uint32_t storage_id, char *data);
+ uint32_t storage_id,
+ const char *data);
int32_t lk_karmaUsb_get_all_file_details (int rio, char **properties);
int32_t lk_karmaUsb_update_file_details (int rio, uint32_t file_id,
char * properties);
diff -r 083f8107331f -r 5dbeb0c02c71 src/lkarma.h
--- a/src/lkarma.h Sun Jul 30 11:10:47 2006
+++ b/src/lkarma.h Sun Jul 30 21:07:58 2006
@@ -38,7 +38,8 @@
int32_t lk_karma_release_io_lock (int rio);
int32_t lk_karma_write_file_chunk (int rio, uint64_t offset,
uint64_t size, uint32_t file_id,
- uint32_t storage_id, char *data);
+ uint32_t storage_id,
+ const char *data);
int32_t lk_karma_get_all_file_details (int rio, char **properties);
int32_t lk_karma_get_file_details (int rio, uint32_t file_id,
char **properties);
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
linux-karma-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-karma-devel